Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ITI snitfladerne kaldes som SOAP web services, og er i det såkaldte XML basererede "RIM format", der er specificeret af IHE XDS standarden. Open eHealth frameworket kan blandt andet mappe fra RIM formatet til en en "OpeneHealth core model", som er java klasser. Og gør det at udvikle ITI kald lettere at arbejde med.

Helt overordnet kan det at lave et ITI kald deles op i følgende trin

  1. Opret kald i OpeneHealth code core model
    1. For iti41 kald indebærer det blandt andet opret/indlæs af dokument samt opret af metadata til documententry
    2. For iti42, 57 og 61 indebærer det oprettelse af metadata
  2. Udfør kald - det transformeres til RIM format på vej ud, og tilbage til core model ved returnering vha. openeHealth frameworket
  3. Aflæs kaldets svar og håndter eventuelle fejl returneret

...

I afsnittene nedenfor, som omhandler understøttelse af bruger historierne "opret stable dokument", "ret stable dokument" og "slet dokument"  er der vist psodokodepseudocode, som illustrerer, hvordan man kan implementere kaldene vha. ovennævnte metode. Afsnittene hænger sådan sammen, at for den givne brugerhistorie kan man se koden (OpeneHealth core model), som skaber kaldet, og hvilke request og response (rim format) det medfører. Som skrevet er der tale om psodokodepseudocode, for at illustrere principperne, og ikke fuldt implementeret logik, som kan kopieres, som det er.

...

Det følgende eksempel viser, hvordan man kan sætte værdierne i documententry. Se "den danske metadta profil" for specifikke detaljer.

Code Block
languagejava
titleEksempel på oprettelse af documententry
linenumberstrue
collapsetrue
public DocumentEntry createDocumentEntry() {

 	    sourcePatientInfo.setName(new XpnName("Berggren", "Nancy", "Ann", null, null, null));
 	 sourcePatientInfo.setGender("F");
 	 sourcePatientInfo.setDateOfBirth("19481225");

	return createDocumentEntry(new Code("2512489996", new LocalizedString("CPR"), "1.2.208.176.1.2"),    // OID for CPR registret (se XDS metadata value set)
 			new Code("12345679999", new LocalizedString("DROS Testafdeling"), "1.2.208.176.1.1"),    // OID for SOR (XDS metadata value set)
  			"20220221113011", "20220221113011", "20220221113011", // datoer skal angives i UTC tid
			new Code("001", new LocalizedString("Klinisk rapport"), "1.2.208.184.100.9"), 
			new Code("N", new LocalizedString("N"), "2.16.840.1.113883.5.25"), 
			null, 
			new Code("urn:ad:dk:medcom:appointmentsummary:full", new LocalizedString("DK Appointment Summary Document schema"), "1.2.208.184.100.10"), 
			new Code("22232009", new LocalizedString("hospital"), "2.16.840.1.113883.6.96"), 
			"da-DK", 
			"text/xml", 
			"Dato og tidspunkt for møde mellem patient og sundhedsperson", 
			new Code("39289-4", new LocalizedString("Follow-up (referred to) provider &or specialist, appointment date"), "2.16.840.1.113883.6.1"), 
			new Code("408443003", new LocalizedString("almen medicin"), "2.16.840.1.113883.6.96"), 
 			sourcePatientInfo,
 			"urn:uuid:69d3b9f3-7919-40e0-8731-32fb339216c2", // dette er det entryuuid, som skal anvendes i forbindelse med evt. ret og slet dokument
			"8438472030670286734.7450729509229840524.1645439411709",
			"8438472030670286734.7450729509229840524.1645439411709");
}


public DocumentEntry createDocumentEntry(Code patientId, Code organisation, String creationTime, String serviceStartTime, String serviceStopTime, Code classCode, Code confidentialityCode, List<Code> eventCodes, Code formatCode, Code healthcareFacilityTypeCode, 
		 String languageCode, String mimeType, String title, Code typeCode, Code practiceSettingCode, String documentEntryUuid, String uniqueId, String logicalId) {
	
	// Opret DocumentEntry for CDA dokumentet
	DocumentEntry documentEntry = new DocumentEntry();
	documentEntry.setEntryUuid(documentEntryUuid); //
	documentEntry.setUniqueId(uniqueId);
	documentEntry.setLogicalUuid(logicalId);

	// Patient Identification
	Identifiable patientIdentifiable = null;
	if (patientId != null) {
		AssigningAuthority patientIdAssigningAuthority = new AssigningAuthority(patientId.getSchemeName());
		patientIdentifiable = new Identifiable(patientId.getCode(), patientIdAssigningAuthority);
	}
	documentEntry.setPatientId(patientIdentifiable);
	documentEntry.setSourcePatientId(patientIdentifiable);


	// Opret author (Organisation)
	AssigningAuthority organisationAssigningAuthority = new AssigningAuthority(organisation.getSchemeName());
	Author author = new Author();
	if (organisation != null && organisation.getCode() != null) {
		String orgDisplayname = (organisation.getDisplayName() != null ? organisation.getDisplayName().getValue() : "");
		Organization authorOrganisation = new Organization(orgDisplayname, organisation.getCode(), organisationAssigningAuthority);
		author.getAuthorInstitution().add(authorOrganisation);
	}
	documentEntry.setAuthor(author);

	// Availability Status (enumeration: APPROVED, SUBMITTED, DEPRECATED)
	documentEntry.setAvailabilityStatus(AvailabilityStatus.APPROVED);

	// Datoer - skal angives i UTC tid
	if (creationTime != null) {
		documentEntry.setCreationTime(creationTime);
	}
	if (serviceStartTime != null) {
		documentEntry.setServiceStartTime(serviceStartTime);
	}
	if (serviceStopTime != null) {
		documentEntry.setServiceStopTime(serviceStopTime);
	}

	if (classCode != null) {
		documentEntry.setClassCode(classCode);
	}
	if (confidentialityCode != null) {
		documentEntry.getConfidentialityCodes().add(confidentialityCode);
	}

	List<Code> eventCodesEntry = documentEntry.getEventCodeList();
	if (eventCodes != null) {
		for (Code eventCode : eventCodes) {
			eventCodesEntry.add(eventCode);
		}
	}
	if (formatCode != null) {
		documentEntry.setFormatCode(formatCode);
	}
	if (healthcareFacilityTypeCode != null) {
		documentEntry.setHealthcareFacilityTypeCode(healthcareFacilityTypeCode);
	}
	if (languageCode != null) {
		documentEntry.setLanguageCode(languageCode);
	}
	if (mimeType != null) {
		documentEntry.setMimeType(mimeType);
	}
	documentEntry.setType(DocumentEntryType.STABLE);
	if (title != null) {
		documentEntry.setTitle(new LocalizedString(title));
	}
	if (typeCode != null) {
		documentEntry.setTypeCode(typeCode);
	}
	if (practiceSettingCode != null) {
		documentEntry.setPracticeSettingCode(practiceSettingCode);
	}
	return documentEntry;
}

...

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:dokumententry. entryUuidFoDocuemntToReplace vil være urn:uuid:69d3b9f3-7919-40e0-8731-32fb339216c2 ifald man vil rette det oprindelige dokument fra "Opret Stable Dokument".

Code Block
languagejava
titleEksempel på association for rettelse
linenumberstrue
// Hvis det er en opdatering af dokumentet, oprettes association mellem det gamle og det nye dokument vha. entryuuid'erne
if (doReplace && entryUuidForDocumentToReplace != null) {
 	Association replacementAssociation = new Association(AssociationType.REPLACE, generateUUID(), documentEntry.getEntryUuid(), entryUuidForDocumentToReplace);
 	provideAndRegisterDocumentSet.getAssociations().add(replacementAssociation);
}

...

Og at oprette en association kan gøres som følgende. TargetUuid vil være urn:uuid:69d3b9f3-7919-40e0-8731-32fb339216c2 ifald man vil rette det oprindelige dokument fra "Opret Stable Dokument".

Code Block
languagejava
titleEksempel på association
linenumberstrue
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;
}

...