GS1 BMS XML
SanteDB provides a basic implementation of the GS1 Business Messaging Standard (BMS) 3.3 for conveying stock transactions to logistics systems.
The SanteDB GS1 BMS interfaces are undergoing refactoring from OpenIZ. The information in these pages document the OpenIZ GS1 plugin that is currently ported to SanteDB however has not been validated.

GS1 Stock Messaging Workflows

The overall order flow in SanteDB follows the order flow in GS1:
  1. 1.
    An order is created in SanteDB (a Request for Supply Act ) which is stored with product classes and quantities requested.
  2. 2.
    SanteDB's iCDR constructs a Order message and sends it to the supplier
  3. 3.
    The supplier validates the order and responds to SanteDB with an OrderResponse which is linked in SanteDB (a Promise to Supply which Fulfills the Request for Supply)
  4. 4.
    The supplier picks and packs the order and despatches the order sending SanteDB with actual product (GTIN and LOT#) via a DespatchAdvice , SanteDB stores the order in RIM (a EventOccurence Supply which documents Departure of the Promise for Supply)
  5. 5.
    The product arrives at the clinic, the clinic staff count and verify the product and confirm receipt (a EventOccurrence of Supply which documents Arrival of the EventOccurence Supply)
  6. 6.
    SanteDB's iCDR constructs a ReceiveAdvice message and sends it to the supplier.

Order Flow

The order flow is triggered whenever a client of the iCDR submits an Act with mood code Request and a type of Supply (i.e. Request for Supply). When configured, the iCDR will construct a GS1 Order message and will issue the message over AS.2 over HTTP with mime encoded attachment or can perform a simple POST with the order message as the request.
The logistics management information system may perform an internal approval of the order and can accept the order (with modifications to the quantities) via a GS1 Order Response.
The order and order response is made up of a series of tradeItemDetail which are mapped to the Product participations in the original Supply request (these are typically Materials). If an order response is set then the iCDR creates a new Act with mood-code of Promise linking the new act with the request act as a Fulfills relationship.
For example, an order request from Elbonia's Good Health Hospital:
1
<?xml version="1.0"?>
2
<orderMessage xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:gs1:ecom:order:xsd:3">
3
<StandardBusinessDocumentHeader xmlns="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader">
4
<HeaderVersion>1.0</HeaderVersion>
5
<Sender>
6
<!-- Truncated -->
7
</Sender>
8
<DocumentIdentification>
9
<Standard>GS1</Standard>
10
<TypeVersion>3.3</TypeVersion>
11
<InstanceIdentifier>44432A5701A4F209</InstanceIdentifier>
12
<Type>order</Type>
13
<MultipleType>false</MultipleType>
14
<CreationDateAndTime>2020-11-12T01:30:49.4634744-08:00</CreationDateAndTime>
15
</DocumentIdentification>
16
</StandardBusinessDocumentHeader>
17
<order xmlns="">
18
<creationDateTime>2020-11-12T01:30:46.219541</creationDateTime>
19
<documentStatusCode>ORIGINAL</documentStatusCode>
20
<orderIdentification>
21
<entityIdentification>2227710f-5b6a-49ea-893e-13bb483b2cf4</entityIdentification>
22
</orderIdentification>
23
<isApplicationReceiptAcknowledgementRequired>true</isApplicationReceiptAcknowledgementRequired>
24
<isOrderFreeOfExciseTaxDuty>false</isOrderFreeOfExciseTaxDuty>
25
<orderLogisticalInformation>
26
<shipTo>
27
<additionalPartyIdentification additionalPartyIdentificationTypeCode="HIE_FRID">urn:uuid:b2955791-ea33-3048-a438-866188819d7f</additionalPartyIdentification>
28
<address>
29
<street>23 Main Street</street>
30
<city>Muddsville</city>
31
<countryCode>ELB</countryCode>
32
<state>MU</state>
33
</address>
34
<organisationDetails>
35
<organisationName>Good Health Hospital</organisationName>
36
</organisationDetails>
37
</shipTo>
38
<orderLogisticalDateInformation>
39
<requestedDeliveryDateTime>
40
<date>2020-11-12</date>
41
</requestedDeliveryDateTime>
42
</orderLogisticalDateInformation>
43
</orderLogisticalInformation>
44
<orderLineItem>
45
<lineItemNumber>1</lineItemNumber>
46
<requestedQuantity measurementUnitCode="dose" codeListVersion="UCUM">20</requestedQuantity>
47
<additionalOrderLineInstruction languageCode="en">FRAGILE</additionalOrderLineInstruction>
48
<additionalOrderLineInstruction languageCode="en">KEEP REFRIGERATED</additionalOrderLineInstruction>
49
<transactionalTradeItem>
50
<tradeItemDescription>HPV</tradeItemDescription>
51
<itemTypeCode codeListVersion="CVX">137</itemTypeCode>
52
<tradeItemClassification>
53
<additionalTradeItemClassificationCode codeListVersion="VIMS_ITEM_ID">2429</additionalTradeItemClassificationCode>
54
</tradeItemClassification>
55
</transactionalTradeItem>
56
</orderLineItem>
57
<!-- Repeat orderLineItem -->
58
</order>
59
</orderMessage>
Copied!

Order Despatch

Once the order is approved by the LMIS / Distributor it is expected that the requested order will be picked and packed. Once the order has been despatched (i.e. it is on a truck, or courier, etc.) the LMIS will respond with a GS1 Despatch Advice message.
The Despatch Advice differs from the Order message in that it contains:
  • The actual quantity of each item packed and shipped
  • The actual product codes (GTIN) and lot #'s of products shipped
  • The expected date of delivery (EDD)
The iCDR converts this into an Act with class code of Supply , mood code of EventOccurence and a status of Active, dCDRs will synchronize this from the core iCDR model on their next synchronization, or clients may request the information in any of the supported iCDR messaging formats. The new Act is linked to the original Act with an ActRelationship carrying relationship type of Fulfills (i.e. the new act fulfills the request act)

Orderless Despatch

In some jurisdictions stock is sent without explicit ordering to a facility. These orderless despatches are supported by SanteDB and are implemented as a GS1 DespatchAdvice message with no source order information.

Order Receive

Once an order is received by the remote facility or original caller, the user will open the package and will verify the contents. This may include:
  • Verifying the quantities of stock shipped
  • Verifying the cold storage status (VVM) of any vials of product shipped
  • Identifying breakage and items to be rejected.
The caller creates a new Act with class code Supply with status code of Complete and mood code of EventOccurence. The created act is linked to the despatched act with an ActRelationship carrying type Arrival (i.e. the new act documents the arrival of the previous act).
The previous act has its status code set to Complete .
For example, an order receive message for Good Health Hospital may appear as:
1
<?xml version="1.0"?>
2
<receivingAdviceMessage xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:gs1:ecom:receiving_advice:xsd:3">
3
<StandardBusinessDocumentHeader xmlns="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader">
4
<HeaderVersion>1.0</HeaderVersion>
5
<Sender>
6
<!-- Truncated -->
7
</Sender>
8
<DocumentIdentification>
9
<Standard>GS1</Standard>
10
<TypeVersion>3.3</TypeVersion>
11
<InstanceIdentifier>4281C212207220B2</InstanceIdentifier>
12
<Type>receivingAdvice</Type>
13
<MultipleType>false</MultipleType>
14
<CreationDateAndTime>2020-12-16T23:04:53.7368109-08:00</CreationDateAndTime>
15
</DocumentIdentification>
16
</StandardBusinessDocumentHeader>
17
<receivingAdvice xmlns="">
18
<creationDateTime>2020-12-16T05:21:07.118676</creationDateTime>
19
<documentStatusCode>ORIGINAL</documentStatusCode>
20
<receivingAdviceIdentification>
21
<entityIdentification>4bb1d8cd-d8d6-4531-be43-189661b7a1db</entityIdentification>
22
</receivingAdviceIdentification>
23
<receivingDateTime>2020-12-16T05:21:03.764</receivingDateTime>
24
<reportingCode>FULL_DETAILS</reportingCode>
25
<shipper>
26
<additionalPartyIdentification additionalPartyIdentificationTypeCode="HIE_FRID">urn:uuid:9b573dd9-1e72-3110-9540-8b7cd1a59df4</additionalPartyIdentification>
27
<address>
28
<countryCode>ELB</countryCode>
29
<state>MU</state>
30
</address>
31
<organisationDetails>
32
<organisationName>Muddsville Regional Distribution Centre</organisationName>
33
</organisationDetails>
34
</shipper>
35
<receiver>
36
<additionalPartyIdentification additionalPartyIdentificationTypeCode="HIE_FRID">urn:uuid:04333219-4f77-3a16-947f-b52527b54453</additionalPartyIdentification>
37
<address>
38
<street>23 Main Street</street>
39
<city>Muddsville</city>
40
<countryCode>ELB</countryCode>
41
<state>MU</state>
42
</address>
43
<organisationDetails>
44
<organisationName>Good Health Hospital</organisationName>
45
</organisationDetails>
46
</receiver>
47
<shipTo>
48
<!-- Truncated -->
49
</shipTo>
50
<despatchAdvice>
51
<entityIdentification>a905c25c-47ac-4775-a7be-0498cbeef3cf</entityIdentification>
52
<creationDateTime>2020-09-29T08:54:24.898187</creationDateTime>
53
</despatchAdvice>
54
<receivingAdviceLogisticUnit>
55
<receivingAdviceLineItem>
56
<lineItemNumber>1</lineItemNumber>
57
<quantityAccepted measurementUnitCode="each" codeListVersion="UCUM">80</quantityAccepted>
58
<quantityDespatched measurementUnitCode="each" codeListVersion="UCUM">80</quantityDespatched>
59
<transactionalTradeItem>
60
<gtin>10060123AD</gtin>
61
<tradeItemDescription>BCG Diluent (Serum Institute of India)</tradeItemDescription>
62
<itemTypeCode codeListVersion="OpenIZ-MaterialType">62962d65-be7b-465d-9a92-772ea3ba0d03</itemTypeCode>
63
<transactionalItemData>
64
<batchNumber>068S14079Z</batchNumber>
65
<itemExpirationDate>2021-03-31</itemExpirationDate>
66
</transactionalItemData>
67
</transactionalTradeItem>
68
<receivingConditionInformation>
69
<receivingConditionCode>DAMAGED_PRODUCT_OR_CONTAINER</receivingConditionCode>
70
<receivingConditionQuantity measurementUnitCode="each" codeListVersion="UCUM">0</receivingConditionQuantity>
71
</receivingConditionInformation>
72
<receivingConditionInformation>
73
<receivingConditionCode>GOOD_CONDITION</receivingConditionCode>
74
<receivingConditionQuantity measurementUnitCode="each" codeListVersion="UCUM">80</receivingConditionQuantity>
75
</receivingConditionInformation>
76
</receivingAdviceLineItem>
77
</receivingAdviceLogisticUnit>
78
<!-- Repeat for each Accepted Item -->
79
</receivingAdvice>
80
</receivingAdviceMessage>
Copied!