+
Skip to content

Update valuecodeableconcept coding for inventory characteristic #302

Open
@peterMuriuki

Description

@peterMuriuki

we use characteristics on the group resource to store data pertaining to the inventory fields unicef_section and donor.
After a change in how web retrieves these values i.e. by using Valuesets stored sever-side, web and tooling now create payloads that are different.

Web:
e.g.

{
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "98734231",
        "display": "Unicef Section"
      } ]
    },
    "valueCodeableConcept": {
      "coding": [ {
        "system": "http://smartregister.org/CodeSystem/eusm-unicef-sections",
        "code": "health",
        "display": "health"
      } ],
      "text": "health"
    }
  }, {
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "45981276",
        "display": "Donor"
      } ]
    },
    "valueCodeableConcept": {
      "coding": [ {
        "system": "http://smartregister.org/CodeSystem/eusm-donors",
        "code": "unicef",
        "display": "unicef"
      } ],
      "text": "unicef"
    }
  }

while tooling:

{
        "code": {
          "coding": [
            {
              "system": "http://smartregister.org/codes",
              "code": "98734231",
              "display": "Unicef Section"
            }
          ]
        },
        "valueCodeableConcept": {
          "coding": [
            {
              "system": "http://smartregister.org/codes",
              "code": "98734231-1",
              "display": "Value entered on the unicef section"
            }
          ],
          "text": "$unicef_section"
        }
      },
      {
        "code": {
          "coding": [
            {
              "system": "http://smartregister.org/codes",
              "code": "45981276",
              "display": "Donor"
            }
          ]
        },
        "valueCodeableConcept": {
          "coding": [
            {
              "system": "http://smartregister.org/codes",
              "code": "45981276-1",
              "display": "Value entered on the donor"
            }
          ],
          "text": "$donor"
        }
      }

Notice the valueCodeableConcept.coding is different between the two.

This has the effect that web will not be able to interpret the unicef_section and donor field values from the group resource.

My suggestions:

  1. Logically require the template value for the mentioned fields be an existing code in the corresponding valueSet
  2. Update the payload_template by:
    a. Update valueCodeableConcept.coding.system to point to the correct CodeSystem system url. This can be static, I do not expect we should/need to update this
    b. Interpolate value in a. to valueCodeableConcept.coding.code
    c. Remove the valueCodeableConcept.coding.display and valueCodeableConcept.text

Or:

  1. Logically require the template value for the mentioned fields be an existing code in the corresponding valueSet
  2. Getting an expansion of the Valueset for each respective field i.e be it unicef_Section, donor, maybe even for location.type
  3. Use the expansion in 2 as a lookup and the value in 1 as the key. use the resulting coding as the correct value for valueCodeableConcept.coding
  4. This also inherently adds a validation layer for what values are added for such fields

cc @dubdabasoduba

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载