ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Overview

This is a web service based on SOAP protocol that is designed to return information about access status for drivers.

 

Drivers.png

 

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

  1. Validate request against XSD schema

  2. Validate one of RNOKPP or document is present in the request

    1. in case of an error return fault with faultCode=Server, faultString = “RNOKPP or document must be present”

  3. Validate compositionTitle

    1. Search for Composition with title = getDriversAccessStatusRequest.compositionTitle

      1. in case of an error return fault with faultCode=Server, faultString = “Composition not found”

  4. Validate person

    1. Search for a person using Active person search algorithm

      1. In case 0 or >1 persons found return fault with faultCode=Server, faultString = “Person not found”

      2. In case 1 person found validate that persons id matches Composition.subject from p.3.a

        1. In case persons id doesn't match perform Search Person's merged persons and check if Composition.subject is in merge_person_id

          1. In case Composition.subject is not merge_person_id return faultCode=Server, faultString = “Person not found”

Service logic

  1. 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

    1. in case nothing found return fault with faultCode=”Server”, faultString = “Composition not found”

  2. Create a response according to schema below, populate event array with values from the Composition.event array:

    1. if event array contains only DRIVERS_GROUP2_ADMIT ($.composition.event[?(@.code.coding[].code=="DRIVERS_GROUP2_ADMIT")]):

      1. create an element in getDriversAccessStatusResponse.event

        1. getDriversAccessStatusResponse.event.code= Composition.event.code.coding.code

        2. getDriversAccessStatusResponse.event.period =Composition.event.period

      2. add additional element to event array with following values

        1. getDriversAccessStatusResponse.event.code= DRIVERS_GROUP1_ADMIT

        2. getDriversAccessStatusResponse.event.period =$.composition.event[?(@.code=="DRIVERS_GROUP2_ADMIT")].period

    2. else if `event` array contains only DRIVERS_GROUP1_DENY ($.composition.event[?(@.code.coding[].code=="DRIVERS_GROUP1_DENY")]):

      1. create an element in getDriversAccessStatusResponse.event

        1. getDriversAccessStatusResponse.event.code= Composition.event.code.coding.code

        2. getDriversAccessStatusResponse.event.period =Composition.event.period

      2. add additional element to event array in response with following values

        1. getDriversAccessStatusResponse.event.code= DRIVERS_GROUP2_DENY

        2. getDriversAccessStatusResponse.event.period =$.composition.event[?(@.code=="DRIVERS_GROUP1_DENY")].period

    3. else if `event` array contains DRIVERS_GROUP1_ADMIT or combination [ DRIVERS_GROUP1_ADMIT, DRIVERS_GROUP2_DENY ], or combination [ DRIVERS_GROUP1_DENY, DRIVERS_GROUP2_DENY ]

      1. for each element in Composition.event array create an element in getDriversAccessStatusResponse.event

        1. getDriversAccessStatusResponse.event.code= Composition.event.code.coding.code

        2. getDriversAccessStatusResponse.event.period =Composition.event.period

    4. else return faultCode=”Server”, faultString = “Could not define access status”

  3. populate additionalAdmissionCondition array for each Composition.extension item:

    1. additionalAdmissionCondition.code = Composition.extension[@].valueCodeableConcept.coding[].code

    2. if Composition.extension[@].valueCodeableConcept.extension is not null:

      1. additionalAdmissionCondition.alphabeticalValue[]= Composition.extension[@].valueCodeableConcept.extension[?(@.valueCodeableConcept)].valueCodeableConcept.coding.code

      2. additionalAdmissionCondition.numericalValue=Composition.extension[@].valueCodeableConcept.extension[?(@.valueDecimal)].valueDecimal

  4. 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:

  • VersionMismatch—Invalid namespace defined in SOAP envelope element. The SOAP envelope must conform to the http://schemas.xmlsoap.org/soap/envelope namespace.

  • MustUnderstand—SOAP header entry not understood by processing party.

  • Client—Message was incorrectly formatted or is missing information.

  • Server—Problem with the server that prevented message from being processed.

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>
  • No labels