Page History
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
// Indlæs dokumentet, som skal registreres String documentPayload = getAppointmentXmlDocument(); // Opret documentEntry DocumentEntry documentEntry = createDocumentEntry(); // Opret kald/request ProvideAndRegisterDocumentSetRequestType provideAndRegisterDocumentSetRequest = buildProvideAndRegisterDocumentSetRequestAftale(documentEntry, documentPayload); try { // Udfør kald RegistryResponseType registryResponse = iti41PortType.documentRepositoryProvideAndRegisterDocumentSetB(provideAndRegisterDocumentSetRequest); // Aflæs kaldets svar handleResponse(registryResponse); } catch (WebServiceException e) { // Håndter exception } |
En del af felterne i documentEntry er felter, som kan findes i selve XML dokumentet. Derfor kan det at lave en documentEntry gøres på 2 måder: Hvis man selv har skabt XML dokumentet, så har man disse felters værdi og kan sætte dem direkte. Er XML dokumentet skabt på forhånd, kan man unparse det, og hente relevante informationer ud.
Når man udfylder documentEntry med metadata skal man overholde de danske regler defineret af Medcom (links fundet feb 2022):
- Den danske metadata profil: https://svn.medcom.dk/svn/drafts/Standarder/IHE/DK_profil_metadata/Metadata-v096.pdf
- Lister over tilladte værdier: http://svn.medcom.dk/svn/drafts/Standarder/IHE/OID/DK-IHE_Metadata-Common_Code_systems-Value_sets.xlsx
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public ProvideAndRegisterDocumentSetRequestType buildProvideAndRegisterDocumentSetRequest(DocumentEntry documentEntry, String documentPayload, Code contentTypeCode) { ProvideAndRegisterDocumentSet provideAndRegisterDocumentSet = new ProvideAndRegisterDocumentSet(); Document document = new Document(documentEntry, new DataHandler(new ByteArrayDataSource(documentPayload.getBytes(), documentEntry.getMimeType()))); provideAndRegisterDocumentSet.getDocuments().add(document); // Opret SubmissionSet for dokumentet SubmissionSet submissionSet = createSubmissionSet(documentEntry.getPatientId(), new Code("39289-4", new LocalizedString("Follow-up (referred to) provider &or specialist, appointment date"), "2.16.840.1.113883.6.1"), "120220221113011"); provideAndRegisterDocumentSet.setSubmissionSet(submissionSet); // Opret association mellem SubmissionSet og DocumentEntry Association association = createAssociation(submissionSet, documentEntry); provideAndRegisterDocumentSet.getAssociations().add(association); // Transformer request - dette laver core model om til RIM format ProvideAndRegisterDocumentSetTransformer registerDocumentSetTransformer = new ProvideAndRegisterDocumentSetTransformer(ebXMLFactory); EbXMLProvideAndRegisterDocumentSetRequest30 ebxmlRequest = (EbXMLProvideAndRegisterDocumentSetRequest30) registerDocumentSetTransformer.toEbXML(provideAndRegisterDocumentSet); ProvideAndRegisterDocumentSetRequestType provideAndRegisterDocumentSetRequestType = ebxmlRequest.getInternal(); return provideAndRegisterDocumentSetRequestType; } |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public SubmissionSet createSubmissionSet(Identifiable patientIdentifiable, Code contentTypeCode, String submissionTime) { SubmissionSet submissionSet = new SubmissionSet(); submissionSet.setUniqueId(generateId()); submissionSet.setSourceId(generateId()); submissionSet.setEntryUuid(generateUUID()); submissionSet.setPatientId(patientIdentifiable); submissionSet.setContentTypeCode(contentTypeCode); submissionSet.setAvailabilityStatus(AvailabilityStatus.APPROVED); if (submissionTime != null) { submissionSet.setSubmissionTime(submissionTime); } return submissionSet; } |
Og at oprette en association kan gøres som:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public Association createAssociation(SubmissionSet submissionSet, DocumentEntry documentEntry) {
// Opret association mellem SubmissionSet og DocumentEntry
Association association = new Association();
association.setAssociationType(AssociationType.HAS_MEMBER);
association.setEntryUuid(generateUUID());
association.setSourceUuid(submissionSet.getEntryUuid());
association.setTargetUuid(documentEntry.getEntryUuid());
association.setAvailabilityStatus(AvailabilityStatus.APPROVED);
association.setLabel(AssociationLabel.ORIGINAL);
return association;
} |
...
Code Block | ||||
---|---|---|---|---|
| ||||
public void handleResponse(RegistryResponseType registryResponse) { if (registryResponse.getStatus().equals(Status.SUCCESS.getOpcode30()) ) { // Kaldet gik godt } else { // Der er fejl i kaldet, håndter dem for (RegistryError error : registryResponse.getRegistryErrorList().getRegistryError()) { } } } |
I requestet nedenfor ses selve dokumentet (som MTOM attachment) samt de specificerede metadata (den del af requestet, der er i tag SubmitObjectsRequest).
...
Derudover er det anvenderens opgave at specificere, hvilket dokument der skal rettes. Til dette formål anvendes Document Entry UUID, hvorunder dokumentet er registreret i det nationale XDS Registry. Dette angives i forbindelse med "Opret Stable Dokument" se ovenfor. (Alternativt kan dette UUID findes ved først at gennemføre en søgning mod Dokumentdelingsservicen). I requestet angives dette med en Association med typen RPLC (replace).
Et En rettelse laves på samme måde, som ovenfor angivet ovenfor med opret et nyt dokument. Men derudover skal der, når man laver ProvideAndRegisterDocumentSetRequestType, oprettes en association mellem det gamle og det nye dokument:
...
Deruodover er det anvenderens opgave at specificere, hvilket dokument der skal slettemarkeres (deprecates). Som det fremgår af nedenstående skal data fra den Document Entry, der ønskes slettemarkeret medsendes i requestet. Disse data angives i forbindelse med "Opret Stable Dokument" . (og har man dem derfra kan de anvendes. Alternativt kan der gennemføres en søgning mod Dokumentdelingsservicen for at finde disse data).
Helt overordnet vil et kald ITI-57 kunne laves med:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
// Skaf documententry detaljer, som skal deprecates
DocumentEntry documentEntryToDeprecate = getDocumentEntryToDeprecate();
// Opret kald/ request
SubmitObjectsRequest submitObjectsRequest = createDeprecateRequest(documentEntryToDeprecate);
// Udfør kald
RegistryResponseType registryResponse = iti57PortType.documentRegistryUpdateDocumentSet(submitObjectsRequest);
// Aflæs kaldets svar
handleResponse(registryResponse); |
At lave SubmitObjectsRequest kan gøres på følgende måde:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public SubmitObjectsRequest createDeprecateRequest(DocumentEntry documentEntryToDeprecate) {
RegisterDocumentSet request = new RegisterDocumentSet();
// Opret SubmissionSet for dokumentet der skal deprecates
SubmissionSet submissionSet = createSubmissionSetForDocumentEntry(generateUUID(), documentEntryToDeprecate);
request.setSubmissionSet(submissionSet);
// Opret association mellem SubmissionSet og DocumentEntry der skal deprecates
Association association = createAssociateDeprecateStatus(submissionSet, documentEntryToDeprecate);
request.getAssociations().add(association);
// Transformer request - dette laver core model om til RIM format
RegisterDocumentSetTransformer requestTransformer = new RegisterDocumentSetTransformer(ebXMLFactory);
EbXMLSubmitObjectsRequest30 ebxmlRequest = (EbXMLSubmitObjectsRequest30) requestTransformer.toEbXML(registerDocumentSet);
SubmitObjectsRequest submitObjectsRequest = ebxmlRequest.getInternal();
return submitObjectsRequest;
} |
At oprette SubmissionSet kan gøres som:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public SubmissionSet createSubmissionSetForDocumentEntry(String id, DocumentEntry documentEntryToDeprecate) {
SubmissionSet submissionSet = new SubmissionSet();
submissionSet.setEntryUuid(id);
submissionSet.setLogicalUuid(id);
submissionSet.setUniqueId(documentEntryToDeprecate.getEntryUuid());
submissionSet.setPatientId(documentEntryToDeprecate.getPatientId());
submissionSet.setSourceId(documentEntryToDeprecate.getRepositoryUniqueId());
submissionSet.setContentTypeCode(documentEntryToDeprecate.getTypeCode());
submissionSet.setSubmissionTime(new DateTime());
return submissionSet;
} |
Og at oprette en association kan gøres som:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public Association createAssociateDeprecateStatus(SubmissionSet submissionSet, DocumentEntry documentEntryToDeprecate) {
Association association = new Association();
association.setAssociationType(AssociationType.UPDATE_AVAILABILITY_STATUS);
association.setSourceUuid(submissionSet.getLogicalUuid());
association.setTargetUuid(documentEntryToDeprecate.getEntryUuid());
association.setOriginalStatus(documentEntryToDeprecate.getAvailabilityStatus());
association.setNewStatus(AvailabilityStatus.DEPRECATED);
return association;
} |
I requestet nedenfor ses både ny og gammel status under <Association> ligsom også documententry fremgår her med attributten targetObject.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
--------------------------- ID: 12 Address: https://drosurl/dros/iti57 Encoding: --------------------------- ID: 12 Address: https://drosurl/dros/iti57 Encoding: UTF-8 Http-Method: POST Content-Type: application/soap+xml Headers: {Accept=[*/*]} Payload: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> .... fjernet for overskueligehed... </soap:Header> <soap:Body> <ns5:SubmitObjectsRequest xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns4="urn:ihe:iti:xds-b:2007" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"> <ns2:RegistryObjectList> <ns2:RegistryPackage lid="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" id="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4"> <ns2:Slot name="submissionTime"> <ns2:ValueList> <ns2:Value>20210324121634</ns2:Value> </ns2:ValueList> </ns2:Slot> <ns2:Classification classificationScheme="urn:uuid:aa543740-bdda-424e-8c96-df4873be8500" classifiedObject="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" nodeRepresentation="39289-4" id="urn:uuid:4408bca9-abcc-415e-b00d-a8b19f067b09"> <ns2:Slot name="codingScheme"> <ns2:ValueList> <ns2:Value>2.16.840.1.113883.6.1</ns2:Value> </ns2:ValueList> </ns2:Slot> <ns2:Name> <ns2:LocalizedString xml:lang="en-US" charset="UTF-8" value="Dato og tidspunkt for møde mellem patient og sundhedspersonFollow-up (referred to) provider &or specialist, appointment date"/> </ns2:Name> </ns2:Classification> <ns2:ExternalIdentifier registryObject="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" identificationScheme="urn:uuid:6b5aea1a-874d-4603-a4bc-96a0a7b38446" value="2512489996^^^&1.2.208.176.1.2&ISO" id="urn:uuid:324aed91-6339-4452-8678-2aa81a3e16d9"> <ns2:Name> <ns2:LocalizedString value="XDSSubmissionSet.patientId"/> </ns2:Name> </ns2:ExternalIdentifier> <ns2:ExternalIdentifier registryObject="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" identificationScheme="urn:uuid:96fdda7c-d067-4183-912e-bf5ee74998a8" value="urn:uuid:6fe0081c-1efb-4015-8193-2ba551e3b568" id="urn:uuid:cd6acb6f-258c-4250-b46f-1eff52490f28"> <ns2:Name> <ns2:LocalizedString value="XDSSubmissionSet.uniqueId"/> </ns2:Name> </ns2:ExternalIdentifier> <ns2:ExternalIdentifier registryObject="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" identificationScheme="urn:uuid:554ac39e-e3fe-47fe-b233-965d2a147832" value="8085010197220234434.5099172141722846448.1616588194038" id="urn:uuid:6b60e4db-a67c-4ae3-9738-c2b1587a9e7a"> <ns2:Name> <ns2:LocalizedString value="XDSSubmissionSet.sourceId"/> </ns2:Name> </ns2:ExternalIdentifier> </ns2:RegistryPackage> <ns2:Classification classifiedObject="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" classificationNode="urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd" id="urn:uuid:89811458-f16e-46b1-9d2e-bd8944766f86"/> <ns2:Association associationType="urn:ihe:iti:2010:AssociationType:UpdateAvailabilityStatus" sourceObject="d7ebbb2b-b153-45ac-93fa-f24393c6cbe4" targetObject="urn:uuid:6fe0081c-1efb-4015-8193-2ba551e3b568"> <ns2:Slot name="OriginalStatus"> <ns2:ValueList> <ns2:Value>urn:oasis:names:tc:ebxml-regrep:StatusType:Approved</ns2:Value> </ns2:ValueList> </ns2:Slot> <ns2:Slot name="NewStatus"> <ns2:ValueList> <ns2:Value>urn:oasis:names:tc:ebxml-regrep:StatusType:Deprecated</ns2:Value> </ns2:ValueList> </ns2:Slot> </ns2:Association> </ns2:RegistryObjectList> </ns5:SubmitObjectsRequest> </soap:Body> </soap:Envelope> -------------------------------------- |
...