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

EUSM - Add support for importing products #154

Closed
Wambere opened this issue Mar 1, 2024 · 6 comments
Closed

EUSM - Add support for importing products #154

Wambere opened this issue Mar 1, 2024 · 6 comments
Labels

Comments

@Wambere
Copy link
Contributor

Wambere commented Mar 1, 2024

Current products structure from opensrp 1.0

From https://example.smartregister.org/opensrp/rest/product-catalogue

{
    "uniqueId": 6321,
    "productName": "Thermometer",
    "isAttractiveItem": true,
    "materialNumber": "223",
    "availability": "In the clinic or dispenser triage section.",
    "condition": "It can measure the temperature of a human being.",
    "appropriateUsage": "To measure temperature of a human being.",
    "accountabilityPeriod": 4,
    "photoURL": "http://example-staging.smartregister.org/opensrp/multimedia/media/37",
    "serverVersion": 55
 }
@Wambere
Copy link
Contributor Author

Wambere commented Mar 1, 2024

FHIR version

{
    "resource": {
        "resourceType": "Group",
        "id": "7fb62c33-0164-426a-a78a-53f0ef3076f0",
        "identifier": [
            {"use": "official" , "value": "7fb62c33-0164-426a-a78a-53f0ef3076f0"                         },
            {"use": "secondary", "value": "6321"}
          ],
    "active": true,
    "name": "Thermometer"
}

@dubdabasoduba please assist in filling in the above

I also noticed some "characteristics" of the products defined here, where are these from?

@Wambere Wambere changed the title Add support for importing products EUSM - Add support for importing products Mar 1, 2024
@dubdabasoduba
Copy link
Member

{
  "resourceType": "Group",
  "id": "6f3980e0-d1d6-4a7a-a950-939f3ca7b301",
  "identifier": [
    {"use": "official" , "value": "14524533622"                         },
    {"use": "secondary", "value": "9b54d1cd-42cc-4dd4-ba7f-1c1245e5b30c"}
  ],
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system" : "http://snomed.info/sct",
        "code"   : "386452003"             ,
        "display": "Supply management"
      }
    ]
  },
  "name": "Bed nets",
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct",
            "code"   : "23435363"              ,
            "display": "Attractive Item code"
          }
        ]
      },
      "valueBoolean": true
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct",
            "code"   : "34536373"              ,
            "display": "Is it there code"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system" : "http://snomed.info/sct"               ,
            "code"   : "34536373-1"                           ,
            "display": "Value entered on the It is there code"
          }
        ],
        "text": "Value entered on the It is there code"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct"             ,
            "code"   : "45647484"                           ,
            "display": "Is it in good condition? (optional)"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://snomed.info/sct",
            "code": "45647484-1",
            "display": "Value entered on the Is it in good condition? (optional)"
          }
        ],
        "text": "Value entered on the Is it in good condition? (optional)"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct"                    ,
            "code"   : "56758595"                                  ,
            "display": "Is it being used appropriately? (optional)"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://snomed.info/sct",
            "code": "56758595-1",
            "display": "Value entered on the Is it being used appropriately? (optional)"
          }
        ],
        "text": "Value entered on the Is it being used appropriately? (optional)"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct"           ,
            "code"   : "67869606"                         ,
            "display": "Accountability period (in months)"
          }
        ]
      },
      "valueQuantity": {"value": 34}
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct",
            "code"   : "1231415"               ,
            "display": "Product Image code"
          }
        ]
      },
      "valueReference": {
        "reference": "Binary/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"
      }
    }
  ]
}

@Wambere
Copy link
Contributor Author

Wambere commented Mar 4, 2024

Json payload

{
  "resourceType": "Group",
  "id": "$id",
  "identifier": [
    {"use": "official" , "value": "$id"                         },
    {"use": "secondary", "value": "$previous_id"}
  ],
  "active": $active,
  "type": "$type",
  "actual": $actual,
  "code": {
    "coding": [
      {
        "system" : "http://smartregister.org/supply-management",
        "code"   : "386452003"             ,
        "display": "Supply management"
      }
    ]
  },
  "name": "$name",
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/is-attractive",
            "code"   : "23435363"              ,
            "display": "Attractive Item code"
          }
        ]
      },
      "valueBoolean": $isAttractiveItem
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/availability",
            "code"   : "34536373"              ,
            "display": "Is it there code"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system" : "http://smartregister.org/availability"               ,
            "code"   : "34536373-1"                           ,
            "display": "Value entered on the It is there code"
          }
        ],
        "text": "$availability"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/condition"             ,
            "code"   : "45647484"                           ,
            "display": "Is it in good condition? (optional)"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://smartregister.org/condition",
            "code": "45647484-1",
            "display": "Value entered on the Is it in good condition? (optional)"
          }
        ],
        "text":"$condition"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/appropriate-usage"                    ,
            "code"   : "56758595"                                  ,
            "display": "Is it being used appropriately? (optional)"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://smartregister.org/appropriate-usage",
            "code": "56758595-1",
            "display": "Value entered on the Is it being used appropriately? (optional)"
          }
        ],
        "text": "$appropriateUsage"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/accountability-period"           ,
            "code"   : "67869606"                         ,
            "display": "Accountability period (in months)"
          }
        ]
      },
      "valueQuantity": {"value": $accountabilityPeriod}
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/product-image",
            "code"   : "1231415"               ,
            "display": "Product Image code"
          }
        ]
      },
      "valueReference": {
        "reference": "Binary/$image-binary"
      }
    }
  ]
}
  • Where does the materialNumber go?
  • Creating a separate issue to handle the creation of the $image-binary
  • I've also added "endpoints" to the system after the smartregister.org, please edit or remove if not needed

@Wambere
Copy link
Contributor Author

Wambere commented Mar 4, 2024

Potential csv below
Mapping to the json payload in the comment above

Column Source
id input or generated
previous_id uniqueId
active ??
type ??
actual ??
name productName
isAttractiveItem isAttractiveItem
availability availability
condition condition
appropriateUsage appropriateUsage
accountabilityPeriod accountabilityPeriod
image_binary_id generated-binary

cc @dubdabasoduba @ageryck @AnnieMungai

@peterMuriuki
Copy link
Contributor

  1. Update the characteristics codeableConcepts coding.system as defined here here
  2. Update the Group.code codeableConcept coding.system as defined here here
  3. Add Material number as an official identifier. its type coding also defined in the above linked file.
  4. Products type Group.type is substance

ref:


Sample:

{
  "resourceType": "Group",
  "id": "03a19f4e-712e-4436-868b-f6814f2f601b",
  "identifier": [ {
    "type":{
      "coding": {
        "system" : "http://smartregister.org/codes",
        "code"   : "MATNUM"             ,
        "display": "Material Number"
      }
    }
    "use": "official",
    "value": "56dtdhdh"
  } ],
  "active": true,
  "type": "substance",
  "code": {
    "coding": [ {
      "system": "http://snomed.info/sct",
      "code": "386452003",
      "display": "Supply management"
    } ]
  },
  "name": "Lilly Flowers",
  "characteristic": [ {
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "67869606",
        "display": "Accountability period (in months)"
      } ]
    },
    "valueQuantity": {
      "value": 6
    }
  }, {
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "56758595",
        "display": "Is it being used appropriately? (optional)"
      } ]
    },
    "valueCodeableConcept": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "56758595-1",
        "display": "Value entered on the Is it being used appropriately? (optional)"
      } ],
      "text": "."
    }
  }, {
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "45647484",
        "display": "Is it in good condition? (optional)"
      } ]
    },
    "valueCodeableConcept": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "45647484-1",
        "display": "Value entered on the Is it in good condition? (optional)"
      } ],
      "text": "."
    }
  }, {
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "34536373",
        "display": "Is it there code"
      } ]
    },
    "valueCodeableConcept": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "34536373-1",
        "display": "Value entered on the It is there code"
      } ],
      "text": "."
    }
  }, {
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "23435363",
        "display": "Attractive Item code"
      } ]
    },
    "valueBoolean": false
  },{
    "code": {
      "coding": [ {
        "system": "http://smartregister.org/codes",
        "code": "1231415",
        "display": "Product Image code"
      } ]
    },
    "valueReference": {
      "reference": "Binary/d60ff460-7671-466a-93f4-c93a2ebf2077"
    }
  } ]
}

@Wambere
Copy link
Contributor Author

Wambere commented May 9, 2024

Closed by #179

@Wambere Wambere closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants