-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for importing inventory and products (#179)
* Add functionality to import products as Group resources * Update read me * Create images folder if it doesn't already exist * Mock image binary * Add support for importing inventories * Update product-group template * Update inventory-group * Update inventory csv and code * Use GROUP_INDEX_MAPPING in group_extras * black formatting * move deletion to outside the condition
- Loading branch information
Showing
7 changed files
with
854 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name,active,method,id,poNumber,serialNumber,usualId,actual,productId,deliveryDate,accountabilityDate,quantity,unicefSection,donor | ||
Bishop Magua - Bed nets,true,create,8adfcfe0-41d0-4f0a-9a89-909c72fbf330,123523,989682,a065c211-cf3e-4b5b-972f-fdac0e45fef7,false,1d86d0e2-bac8-4424-90ae-e2298900ac3c,2024-02-01T00:00:00.00Z,2025-02-01T00:00:00.00Z,34,Health,GAVI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name,active,method,id,previousId,isAttractiveItem,availability,condition,appropriateUsage,accountabilityPeriod,imageSourceUrl | ||
thermometer,true,create,1d86d0e2-bac8-4424-90ae-e2298900ac3c,10,true,yes,good,ok,12,https://ona.io/home/wp-content//uploads/2022/06/spotlight-fhir.png | ||
sterilizer,true,create,,53209452,true,no,,,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
{ | ||
"request": { | ||
"method": "PUT", | ||
"url": "Group/$unique_uuid", | ||
"ifMatch": "$version" | ||
}, | ||
"resource": { | ||
"resourceType": "Group", | ||
"id": "$unique_uuid", | ||
"identifier": [ | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "SERNUM", | ||
"display": "Serial Number" | ||
} | ||
], | ||
"text": "Serial Number" | ||
}, | ||
"use": "official", | ||
"value": "$serial_number" | ||
}, | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "PONUM", | ||
"display": "PO Number" | ||
} | ||
], | ||
"text": "PO Number" | ||
}, | ||
"use": "secondary", | ||
"value": "$po_number" | ||
}, | ||
{ | ||
"use": "usual", | ||
"value": "$usual_id" | ||
} | ||
], | ||
"active": "$active", | ||
"type": "substance", | ||
"actual": "$actual", | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "78991122", | ||
"display": "Supply Inventory" | ||
} | ||
] | ||
}, | ||
"name": "$name", | ||
"member": [ | ||
{ | ||
"entity": { | ||
"reference": "Group/$product_id" | ||
}, | ||
"period": { | ||
"start": "$delivery_date", | ||
"end": "$accountability_date" | ||
}, | ||
"inactive": false | ||
} | ||
], | ||
"characteristic": [ | ||
{ | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "33467722", | ||
"display": "Quantity" | ||
} | ||
] | ||
}, | ||
"valueQuantity": { | ||
"value": "$quantity" | ||
} | ||
}, | ||
{ | ||
"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" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
{ | ||
"request": { | ||
"method": "PUT", | ||
"url": "Group/$unique_uuid", | ||
"ifMatch" : "$version" | ||
}, | ||
"resource": { | ||
"resourceType": "Group", | ||
"id": "$unique_uuid", | ||
"identifier": [ | ||
{ | ||
"type":{ | ||
"coding": { | ||
"system" : "http://smartregister.org/codes", | ||
"code" : "MATNUM" , | ||
"display": "Material Number" | ||
} | ||
}, | ||
"use": "official", | ||
"value": "$unique_uuid" | ||
}, | ||
{ | ||
"use": "secondary", | ||
"value": "$previous_id" | ||
} | ||
], | ||
"active": "$active", | ||
"type": "substance", | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "386452003", | ||
"display": "Supply management" | ||
} | ||
] | ||
}, | ||
"name": "$name", | ||
"characteristic": [ | ||
{ | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "23435363", | ||
"display": "Attractive Item code" | ||
} | ||
] | ||
}, | ||
"valueBoolean": "$isAttractiveItem" | ||
}, | ||
{ | ||
"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": "$availability" | ||
} | ||
}, | ||
{ | ||
"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": "$condition" | ||
} | ||
}, | ||
{ | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "56758595", | ||
"display": "Is it being used appropriately?" | ||
} | ||
] | ||
}, | ||
"valueCodeableConcept": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "56758595-1", | ||
"display": "Value entered on the Is it being used appropriately?" | ||
} | ||
], | ||
"text": "$appropriateUsage" | ||
} | ||
}, | ||
{ | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "67869606", | ||
"display": "Accountability period (in months)" | ||
} | ||
] | ||
}, | ||
"valueQuantity": { | ||
"value": "$accountabilityPeriod" | ||
} | ||
}, | ||
{ | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://smartregister.org/codes", | ||
"code": "12314156", | ||
"display": "Product Image code" | ||
} | ||
] | ||
}, | ||
"valueReference": { | ||
"reference": "Binary/$image-binary" | ||
} | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.