Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update valuecodeableconcept coding for inventory characteristic #302

Open
peterMuriuki opened this issue Oct 17, 2024 · 0 comments
Open
Assignees
Labels
EUSM help wanted Extra attention is needed Importer

Comments

@peterMuriuki
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EUSM help wanted Extra attention is needed Importer
Projects
None yet
Development

No branches or pull requests

2 participants