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 the a Location Inventory Creation page #1342

Closed
7 tasks
dubdabasoduba opened this issue Feb 25, 2024 · 11 comments · Fixed by #1353
Closed
7 tasks

[EUSM]: Add the a Location Inventory Creation page #1342

dubdabasoduba opened this issue Feb 25, 2024 · 11 comments · Fixed by #1353

Comments

@dubdabasoduba
Copy link
Member

Issue Context?

Issue Implemetation details?

  • Create a page to collect the data on this Data Dictionary
  • The following questions might have different options for other flavours. This might required the use of ValueSet or CodeSystem
    • UNICEF section
    • Donor
  • Serial Number should only be added if the product selected is an attractive item. This should be saved with secondary on the use Identifier property
  • PO Number should be saved with official on the use Identifier property

Issue Acceptance criteria?

  • The ability to add the location inventory

FHIR resources to be used?

No response

Relevant Information

Location Inventory sample resource

{
  "resourceType": "Group",
  "id": "e44e26d0-1f7a-41d6-aa57-99c5712ddd66",
  "identifier": [
    {"use": "secondary", "value": "123214312"                           },
    {"use": "official" , "value": "989867686"                           },
    {"use": "usual"    , "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
  ],
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system" : "http://smartregister.org/",
        "code"   : "78991122"                 ,
        "display": "Supply Inventory"
      }
    ]
  },
  "name": "Bishop Magua -- Bed nets",
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/"  ,
            "code"   : "09887657"                   ,
            "display": "Delivery and Accountability"
          }
        ]
      },
      "valuePeriod": {
        "start": "2024-02-01T00:00:00.00Z",
        "end"  : "2024-02-01T00:00:00.00Z"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/",
            "code"   : "98734231"                 ,
            "display": "Unicef Section"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system" : "http://snomed.info/sct"             ,
            "code"   : "98734231-1"                         ,
            "display": "Value entered on the unicef section"
          }
        ],
        "text": "Value entered on the unicef section"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://snomed.info/sct",
            "code"   : "45647484"              ,
            "display": "Donor"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system" : "http://snomed.info/sct"    ,
            "code"   : "45647484-1"                ,
            "display": "Value entered on the donor"
          }
        ],
        "text": "Value entered on the donor"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/",
            "code"   : "33467722"                 ,
            "display": "Product reference"
          }
        ]
      },
      "valueReference": {
        "reference": "Group/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"
      }
    }
  ]
}
@dubdabasoduba dubdabasoduba added this to the M1.2.24 milestone Feb 25, 2024
@dubdabasoduba dubdabasoduba added this to To do in OpenSRP web app via automation Feb 25, 2024
@peterMuriuki peterMuriuki modified the milestones: M1.2.24, M3.1.24 Mar 4, 2024
@peterMuriuki
Copy link
Collaborator

valueset values source for the donor, and unicef sections : #1338 (comment)

@peterMuriuki

This comment was marked as resolved.

@peterMuriuki
Copy link
Collaborator

peterMuriuki commented Mar 12, 2024

@dubdabasoduba This is what I think we should probably end up with for an inventory group resource

{
  "resourceType": "Group",
  "id": "e44e26d0-1f7a-41d6-aa57-99c5712ddd66",
  // no need identifiers
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system": "http://smartregister.org/",
        "code": "78991122",
        "display": "Supply Inventory"
      }
    ]
  },
  "name": "Kiambu -- Bed nets",
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/",
            "code": "09887657",
            "display": "Delivery and Accountability"
          }
        ]
      },
      "valuePeriod": {
        "start": "2024-02-01T00:00:00.00Z",
        "end": "2024-02-01T00:00:00.00Z"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/", // refactored from snomed
            "code": "98734231",
            "display": "Unicef Section"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          // showing the source codeSystem instead of generic data capture coding
          {
            "system": "http://smartregister.org/CodeSystem/eusm-unicef-sections",
            "code": "Health",
            "display": "Health"
          }
        ],
        "text": "Health"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/", // refactored from snomed
            "code": "45647484",
            "display": "Donor"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          // showing the source codeSystem instead of generic data capture coding
          {
            "system": "http://smartregister.org/CodeSystem/eusm-donors",
            "code": "GAVI",
            "display": "GAVI"
          }
        ],
        "text": "GAVI"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/",
            "code": "33467722",
            "display": "Product reference"
          }
        ]
      },
      "valueReference": {
        "reference": "Group/52cffa51-fa81-49aa-9944-5b45d9e4c117"
      }
    }
  ]
}

@peterMuriuki
Copy link
Collaborator

peterMuriuki commented Mar 12, 2024

Also since we are seemingly not able to _include resources referenced from within characteristics, could we have the product groups resources added as members to the inventory group resource. This action could possible cover the accountability periods as well such that the final payload is structured as shown below:

{
  "resourceType": "Group",
  "id": "e44e26d0-1f7a-41d6-aa57-99c5712ddd66",
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system": "http://smartregister.org/",
        "code": "78991122",
        "display": "Supply Inventory"
      }
    ]
  },
  "name": "Kiambu -- Bed nets",
  "member": [
    {
      "entity": {
        "reference":"Group/52cffa51-fa81-49aa-9944-5b45d9e4c117"
      },
      "period": {
        "start": "2024-02-01T00:00:00.00Z",
        "end": "2024-02-01T00:00:00.00Z"
      },
      "inactive": false
    }
  ],
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/",
            "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/",
            "code": "45647484",
            "display": "Donor"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://smartregister.org/CodeSystem/eusm-donors",
            "code": "GAVI",
            "display": "GAVI"
          }
        ],
        "text": "GAVI"
      }
    }
  ]
}

I understand this will also hugely affect work elsewhere, but I think might be a worthy optimization. This would help us on the web to instead of

-> fetching the List and include the inventory groups(say they are N in number)
-> having to then perform N requests to get the product catalogue groups.

We could

-> fetch List,
-> then fetch inventory Groups and include referenced poduct catalogue groups. We could even serverside paginate.

or even fetch everything(the inventory list, include the inventory groups, as well as the product groups) in a single go like so:
https://fhir.labs.smartregister.org/fhir/List?subject=46bb8a3f-cf50-4cc2-b421-fe4f77c3e75d&_include=List:item&_include:recurse=Group:member

@dubdabasoduba
Copy link
Member Author

@dubdabasoduba This is what I think we should probably end up with for an inventory group resource

{
  "resourceType": "Group",
  "id": "e44e26d0-1f7a-41d6-aa57-99c5712ddd66",
  // no need identifiers
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system": "http://smartregister.org/",
        "code": "78991122",
        "display": "Supply Inventory"
      }
    ]
  },
  "name": "Kiambu -- Bed nets",
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/",
            "code": "09887657",
            "display": "Delivery and Accountability"
          }
        ]
      },
      "valuePeriod": {
        "start": "2024-02-01T00:00:00.00Z",
        "end": "2024-02-01T00:00:00.00Z"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/", // refactored from snomed
            "code": "98734231",
            "display": "Unicef Section"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          // showing the source codeSystem instead of generic data capture coding
          {
            "system": "http://smartregister.org/CodeSystem/eusm-unicef-sections",
            "code": "Health",
            "display": "Health"
          }
        ],
        "text": "Health"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/", // refactored from snomed
            "code": "45647484",
            "display": "Donor"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          // showing the source codeSystem instead of generic data capture coding
          {
            "system": "http://smartregister.org/CodeSystem/eusm-donors",
            "code": "GAVI",
            "display": "GAVI"
          }
        ],
        "text": "GAVI"
      }
    },
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/",
            "code": "33467722",
            "display": "Product reference"
          }
        ]
      },
      "valueReference": {
        "reference": "Group/52cffa51-fa81-49aa-9944-5b45d9e4c117"
      }
    }
  ]
}

@peterMuriuki We use on of the identifiers to store the PO Number. We can add the type on the identifier to communicate what that identifier is for

@dubdabasoduba
Copy link
Member Author

Also since we are seemingly not able to _include referenced resources inside characteristics, could we have the product groups resources added as members to the inventory group resource. This action could possible cover the accountability periods as well such that the final payload is structured as shown below:

{
  "resourceType": "Group",
  "id": "e44e26d0-1f7a-41d6-aa57-99c5712ddd66",
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system": "http://smartregister.org/",
        "code": "78991122",
        "display": "Supply Inventory"
      }
    ]
  },
  "name": "Kiambu -- Bed nets",
  "member": [
    {
      "entity": {
        "reference":"Group/52cffa51-fa81-49aa-9944-5b45d9e4c117"
      },
      "period": {
        "start": "2024-02-01T00:00:00.00Z",
        "end": "2024-02-01T00:00:00.00Z"
      },
      "inactive": false
    }
  ],
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system": "http://smartregister.org/",
            "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/",
            "code": "45647484",
            "display": "Donor"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://smartregister.org/CodeSystem/eusm-donors",
            "code": "GAVI",
            "display": "GAVI"
          }
        ],
        "text": "GAVI"
      }
    }
  ]
}

I understand this will also hugely affect work elsewhere, but I think might be a worthy optimization. This would help us on the web to instead of

-> fetching the List and include the inventory groups(say they are N in number) -> having to then perform N requests to get the product catalogue groups.

We could

-> fetch List, -> then fetch inventory Groups and include referenced poduct catalogue groups. We could even serverside paginate.

or even fetch everything(the inventory list, include the inventory groups, as well as the product groups) in a single go like so: https://fhir.labs.smartregister.org/fhir/List?subject=46bb8a3f-cf50-4cc2-b421-fe4f77c3e75d&_include=List:item&_include:recurse=Group:member

@peterMuriuki this makes sense to me

@dubdabasoduba
Copy link
Member Author

dubdabasoduba commented Mar 13, 2024

@peterMuriuki Since the OpenSRP 2 mobile application syncs by the meta.tag property on the resource, it will not be able to sync the Group and List resources created by this functionality.

For this reason, I think we need to do the same thing we did for the Commodity Module.

Issue Context?

  • We would like to wrap the Location <> Service Point Inventory LIST in a list resource. We would then reference this List resource on the composition resource and then dynamically reference the Location <> Service Point Inventory LIST.

Issue Implementation details?

  • Add a .env variable to the commodity management package. This variable will hold the id of the list resource used to reference the Location <> Service Point Inventory LIST
    • The package should load the List resource at any time it is loaded. In case the list resource is missing then we should create one using the List Resource endpoint. Here is a sample of the List of Resource
      • We should use the id on the .env as the resource id and identifier.official
{
"resourceType": "List",
"id": "ea15c35a-8e8c-47ce-8122-c347cefa1b4a",
"identifier": [
  {"use": "official", "value": "ea15c35a-8e8c-47ce-8122-c347cefa1b4a"}
],
"status": "current",
"mode": "working",
"title": "Supply Chain commodities",
"code": {
  "coding": [
    {
      "system" : "http://smartregister.org/",
      "code"   : "22138876"                 ,
      "display": "Supply Inventory List"
    }
  ],
  "text": "Supply Inventory List"
},
"entry": [
  { "item": {"reference": "List/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"} },
  { "item": {"reference": "Group/e50eb835-7827-4001-b233-e1dda721d4e8"} },
  { "item": {"reference": "List/90b10fdb-592c-47b6-a265-c8806a15d77c"} },
  { "item": {"reference": "Group/dde1cd4f-bef4-4d2b-ad1b-f63b639ed254"} }
]
}
  • Every time we create a Location <> Service Point Inventory LIST resource we then update the LIst resource mentioned above to add a reference of the Location <> Service Point Inventory LIST on the entry attribute of the List Resource.
  • Every time we create a Service Inventory Group resource we then update the LIst resource mentioned above to add a reference of the Service Inventory Group on the entry attribute of the List Resource.

Issue Acceptance criteria?

  • Ability to define an env for the List Resource to hold the Group Resources representing the commodities
  • Ability to create the List resource if a fetch on the List Resource for the id provided on theenv is wrong.
  • Ability to reference all the Location <> Service Point Inventory LIST resources representing the commodities on the List resource.
  • Ability to reference all the Service Inventory Group resources representing the commodities on the List resource.

FHIR resources to be used?

List Resource https://www.hl7.org/fhir/list.html

Relevant Information

No response

@dubdabasoduba
Copy link
Member Author

@peterMuriuki @ciremusyoka Please review the following payload

{
  "resourceType": "Group",
  "id": "e44e26d0-1f7a-41d6-aa57-99c5712ddd66",
  "identifier": [
    {
      "use": "secondary",
      "type": {
        "coding": [
          {
            "system" : "http://smartregister.org/",
            "code"   : "PONUM"                    ,
            "display": "PO Number"
          }
        ],
        "text": "PO Number"
      },
      "value": "123214312"
    },
    {
      "use": "official",
      "type": {
        "coding": [
          {
            "system" : "http://smartregister.org/",
            "code"   : "SERNUM"                   ,
            "display": "Serial Number"
          }
        ],
        "text": "Serial Number"
      },
      "value": "989867686"
    },
    {"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
  ],
  "active": true,
  "type": "substance",
  "actual": false,
  "code": {
    "coding": [
      {
        "system" : "http://smartregister.org/",
        "code"   : "78991122"                 ,
        "display": "Supply Inventory"
      }
    ]
  },
  "name": "Bishop Magua -- Bed nets",
  "member": [
    {
      "entity": {"reference": "Group/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
      "period": {
        "start": "2024-02-01T00:00:00.00Z",
        "end"  : "2024-02-01T00:00:00.00Z"
      },
      "inactive": false
    }
  ],
  "characteristic": [
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/",
            "code"   : "33467722"                 ,
            "display": "Quantity "
          }
        ]
      },
      "valueQuantity": {"value": 34}
    },
    {
      "code": {
        "coding": [
          {
            "system" : "http://smartregister.org/",
            "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://snomed.info/sct",
            "code"   : "45647484"              ,
            "display": "Donor"
          }
        ]
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system" : "http://smartregister.org/CodeSystem/eusm-donors",
            "code"   : "GAVI"                                           ,
            "display": "GAVI"
          }
        ],
        "text": "GAVI"
      }
    }
  ]
}

@dubdabasoduba
Copy link
Member Author

The update has also been made here https://github.com/onaio/fhir-resources/issues/3016

OpenSRP web app automation moved this from To do to Done Mar 26, 2024
@AnnieMungai
Copy link
Collaborator

To be retested once the QA feedback on #1341 is completed.

@Mstjamush
Copy link

@dubdabasoduba
Is this part of the payload mandatory?

{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

5 participants