Overview
This is a web service based on SOAP protocol that is designed to return information about access status for drivers.
Request
In parameters
№ | Key | Hierarchy level | Type | Description | Cardinality |
---|---|---|---|---|---|
1 | getDriversAccessStatusRequest | 1 | object |
| 1..1 |
2 | firstName | 2 | string | Patient first name | 1..1 |
3 | secondName | 2 | string | Patient middle (second) name | 0..1 |
4 | lastName | 2 | string | Patient last (surname) name | 1..1 |
5 | UNZR | 2 | string | UNZR number | 0..1 |
6 | RNOKPP | 2 | string | RNOKPP number | 0..1 |
7 | document | 2 | object |
| 0..1 |
8 | documentType | 3 | string | Document type | 1..1 |
9 | documentNumber | 3 | string | Document number | 1..1 |
10 | compositionTitle | 2 | string | Composition title | 1..1 |
XSD schema
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:tns="http://wldd.io/emal/soapgw/public/drivers" targetNamespace="http://wldd.io/emal/soapgw/public/drivers" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="getDriversAccessStatusRequest" type="tns:getDriversAccessStatusRequest"/> <xs:complexType name="getDriversAccessStatusRequest"> <xs:sequence> <xs:element type="xs:string" name="firstName"/> <xs:element type="xs:string" name="secondName"/> <xs:element type="xs:string" name="lastName" minOccurs="0" nillable="true"/> <xs:element type="xs:string" name="UNZR" minOccurs="0" nillable="true"/> <xs:element type="xs:string" name="RNOKPP" minOccurs="0" nillable="true"/> <xs:element name="document" minOccurs="0" nillable="true"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="documentType"/> <xs:element type="xs:string" name="documentNumber"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element type="xs:string" name="compositionTitle"/> </xs:sequence> </xs:complexType> <xs:element name="getDriversAccessStatusResponse"> <xs:complexType> <xs:sequence> <xs:element name="event" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="code"/> <xs:element name="period"> <xs:complexType> <xs:sequence> <xs:element type="xs:dateTime" name="start"/> <xs:element type="xs:dateTime" name="end" minOccurs="0" nillable="true"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="additionAdmissionCondition" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="code"/> <xs:element type="xs:string" name="alphabeticalValue" maxOccurs="unbounded"/> <xs:element type="xs:decimal" name="numericalValue" minOccurs="0" nillable="true"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Request example
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://example/soapgw/public"> <soapenv:Header/> <soapenv:Body> <pub:getDriversAccessStatusRequest> <pub:firstName>Петро</pub:firstName> <pub:lastName>Іванов</pub:lastName> <pub:UNZR>20090705-00011</pub:UNZR> <pub:RNOKPP>1234567891</pub:RNOKPP> <pub:document> <pub:documentType>PASSPORT</pub:documentType> <pub:documentNumber>АА120518</pub:documentNumber> </pub:document> <pub:compositionTitle>1234-1234-1234-1234</pub:compositionTitle> </pub:getDriversAccessStatusRequest> </soapenv:Body> </soapenv:Envelope>
Validations
Validate request against XSD schema
Validate one of RNOKPP or document is present in the request
in case of an error return fault with faultCode=Server, faultString = “RNOKPP or document must be present”
Validate compositionTitle
Search for Composition with title =
getDriversAccessStatusRequest.compositionTitle
in case of an error return fault with faultCode=Server, faultString = “Composition not found”
Validate person
Search for a person using Active person search algorithm
In case 0 or >1 persons found return fault with faultCode=Server, faultString = “Person not found”
In case 1 person found validate that persons id matches Composition.subject from p.3.a
In case persons id doesn't match perform Search Person's merged persons and check if Composition.subject is in
merge_person_id
In case Composition.subject is not
merge_person_id
return faultCode=Server, faultString = “Person not found”
Service logic
Select the last Composition sorted by Composition.date from ME DB filtered by Composition.subject=patient_id or Composition.subject=merge_person_id (all merged person of this patient_id), Composition.type= DRIVERS, Composition.status= final
in case nothing found return fault with faultCode=”Server”, faultString = “Composition not found”
Create a response according to schema below, populate event array with values from the Composition.event array:
if
event
array contains onlyDRIVERS_GROUP2_ADMIT
($.composition.event[?(@.code.coding[].code=="DRIVERS_GROUP2_ADMIT")]):create an element in getDriversAccessStatusResponse.event
getDriversAccessStatusResponse.event.code= Composition.event.code.coding.code
getDriversAccessStatusResponse.event.period =Composition.event.period
add additional element to
event
array with following valuesgetDriversAccessStatusResponse.event.code= DRIVERS_GROUP1_ADMIT
getDriversAccessStatusResponse.event.period =$.composition.event[?(@.code=="DRIVERS_GROUP2_ADMIT")].period
else if `event` array contains only
DRIVERS_GROUP1_DENY
($.composition.event[?(@.code.coding[].code=="DRIVERS_GROUP1_DENY")]):create an element in getDriversAccessStatusResponse.event
getDriversAccessStatusResponse.event.code= Composition.event.code.coding.code
getDriversAccessStatusResponse.event.period =Composition.event.period
add additional element to
event
array in response with following valuesgetDriversAccessStatusResponse.event.code= DRIVERS_GROUP2_DENY
getDriversAccessStatusResponse.event.period =$.composition.event[?(@.code=="DRIVERS_GROUP1_DENY")].period
else if `event` array contains
DRIVERS_GROUP1_ADMIT
or combination[ DRIVERS_GROUP1_ADMIT, DRIVERS_GROUP2_DENY ],
or combination[ DRIVERS_GROUP1_DENY, DRIVERS_GROUP2_DENY ]
for each element in Composition.event array create an element in getDriversAccessStatusResponse.event
getDriversAccessStatusResponse.event.code= Composition.event.code.coding.code
getDriversAccessStatusResponse.event.period =Composition.event.period
else return faultCode=”Server”, faultString = “Could not define access status”
populate additionalAdmissionCondition array for each Composition.extension item:
additionalAdmissionCondition.code = Composition.extension[@].valueCodeableConcept.coding[].code
if Composition.extension[@].valueCodeableConcept.extension is not null:
additionalAdmissionCondition.alphabeticalValue[]= Composition.extension[@].valueCodeableConcept.extension[?(@.valueCodeableConcept)].valueCodeableConcept.coding.code
additionalAdmissionCondition.numericalValue=Composition.extension[@].valueCodeableConcept.extension[?(@.valueDecimal)].valueDecimal
Return response to the client
Response
Out parameters
Key | Hierarchy level | Type | Description | Cardinality | |
---|---|---|---|---|---|
1 | getDriversAccessStatusResponse | 1 | object |
| 0..1 |
2 | event | 2 | array | Event array | 1..* |
3 | code | 3 | string | Code display value from event array | 1..1 |
4 | period | 3 | object | Period from event array | 1..1 |
5 | start | 4 | dateTime | Start of period (ISO8601 format) | 1..1 |
6 | end | 4 | dateTime | End of period (ISO8601 format) | 0..1 |
7 | additionAdmissionCondition | 2 | array | Addition admission condition | 0..* |
8 | code | 3 | string | Code display value from addition admission condition array | 1..1 |
9 | codeNumber | 3 | string | Code from addition admission condition array | 1..1 |
10 | alphabeticalValue | 3 | array | Alphabetical value from addition admission condition array | 0..* |
11 | numericalValue | 3 | decimal | Numerical value from addition admission condition array | 0..1 |
12 | fault | 1 | object |
| 0..1 |
13 | faultCode | 2 | string | Standard code that provides more information about the fault. A set of code values is predefined by the SOAP specification, as defined below:
| 1..1 |
14 | faultString | 2 | string | A human readable explanation of the fault | 1..1 |
Examples
Example of an error
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope'> <soapenv:Body> <soapenv:Fault> <faultcode>Server</faultcode> <faultstring> Patient not found </faultstring> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>
Example of success
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://example/soapgw/public"> <soapenv:Header/> <soapenv:Body> <pub:getDriversAccessStatusResponse> <pub:event> <pub:code>DRIVERS_GROUP1_Admit</pub:code> <pub:period> <pub:start>2024-10-01T00:00:00.000Z</pub:start> <pub:end>2030-10-01T00:00:00.000Z</pub:end> </pub:period> </pub:event> <pub:event> <pub:code>DRIVERS_GROUP2_Deny</pub:code> <pub:period> <pub:start>2024-10-01T00:00:00.000Z</pub:start> </pub:period> </pub:event> <pub:additionAdmissionCondition> <pub:code>01.01.</pub:code> <pub:alphabeticalValue>a</pub:alphabeticalValue> <pub:alphabeticalValue>b</pub:alphabeticalValue> </pub:additionAdmissionCondition> </pub:getDriversAccessStatusResponse> </soapenv:Body> </soapenv:Envelope>