Page History
...
An STS-signed ID card is obtained by using a company certificate as outlined below:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Properties properties = SignatureUtil.setupCryptoProviderForJVM(); // A new SOSITestFederation(properties), can be used here if the test-environment is used Federation federation = new SOSIFederation(properties); File keystoreFile = … // read in the keystore file String keystorePassword = … // obtain the password to the keystore file CredentialVault vault = new FileBasedCredentialVault( properties, keystoreFile, keystorePassword); SOSIFactory factory = new SOSIFactory(federation, vault, properties); String flowId = … // A unique flow ID is entered in the ID card SystemIDCard systemIDCard = factory.createNewSystemIDCard( …); // Various ID card content parameters are provided here SecurityTokenRequest securityTokenRequest = factory.createNewSecurityTokenRequest(); securityTokenRequest.setIDCard(systemIDCard); SecurityTokenResponse response = … // Send securityTokenRequest to the STS’en and deserialize the // response with factory.deserializeSecurityTokenResponse … IDCard signedIDCard = response.getIDCard(); |
...
3.2.2 Creation and addition of XDSDocumentEntry for on-demand document
Code Block | |
---|---|
linenumbers | true | collapse | true
// Unique identification of the document that must be replaced by an actual value String documentId = "urn:myorg:mydoc:doc:12345"; String repositoryUniqueId = "1.3.6.1.4.1.21367.2010.1.2.300.1"; ExtrinsicObjectType metadata = requestHelper.addOnDemandDocumentMetadataEntry( request documentId, repositoryUniqueId); |
Below it is registered which citizen (patient) the document concerns in addition to which institution/organization that created the document. In this case, the organization id 486651000016002 is provided as a SOR code and the patient is identified with patient id 1122334455 given as a social security number. Both values are coded/formatted as described in [Metadata Profile].
Code Block | linenumbers | true
---|---|
collapse | true | String authorInstitution = "OUH Fælles Akut Amb (Svendborg)^^^^^& 1.2.208.176.1&ISO^^^^486651000016002"; String patientId = "1122334455^^^&2.16.840.1.113883.3.4208.100.2&ISO"; requestHelper.addDocumentMetadataAttributes(metadata, authorInstitution, patientId); // Add additional metadata-information in the same manner |
...
As part of the SubmitObjectsRequest, a description of the complete addition in the form of an XDSSubmissionSet must be provided. This is created and added with:
Code Block | ||
---|---|---|
| ||
RegistryPackageType submissionSet = requestHelper.addSubmissionSet(request);
requestHelper.addSubmissionSetAttributes(submissionSet, patientId);
// Add additional metadata-information in the same manner |
...
The added XDSDocumentEntry figure in the created XDSSubmissionSet, which is why an association between XDSSubmissionSet and XDSDocumentEntry must be added to the SubmitObjectsRequest. This is done with:
Code Block | |
---|---|
true | requestHelper.addAssociation(request, metadata, submissionSet); |
...
If the (new) document metadata described above replaces pre-existing document metadata, then an association as shown below must be added to the SubmitObjectsRequest:
Code Block | ||||
---|---|---|---|---|
| ||||
oasis.names.tc.ebxml_regrep.xsd.rim._3.ObjectFactory objFactory = new oasis.names.tc.ebxml_regrep.xsd.rim._3.ObjectFactory(); AssociationType1 association = objFactory.createAssociationType1(); association.setId(UUID.randomUUID().toString()); association.setAssociationType("urn:ihe:iti:2007:AssociationType:RPLC"); association.setObjectType( "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Association"); association.setSourceObject(metadata.getId()); // Id for new metadata association.setTargetObject(toReplaceId); // Id for metadata to replace // Add replacement-association to the request request.getRegistryObjectList().getIdentifiable().add(objFactory.createAssociation(association)); |
...
Creation of service and port:
Code Block | ||
---|---|---|
| ||
URL wsdl = … // DDS Registry’s.WSDL is named DocumentRegistryService service = new DocumentRegistryService(wsdl, new QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_Service")); DocumentRegistryPortType port = service.getDocumentRegistryPortSoap(); |
Subsequently, the method on the port can be called:
Code Block | ||
---|---|---|
| ||
SubmitObjectsRequestHelper requestHelper = new SubmitObjectsRequestHelper(); SubmitObjectsRequest request = requestHelper.create(); … // request-structure is populated as described above String flowId = XMLUtil.createNonce(); // A unique flow ID that figures in the ID card is created // using SEAL DGWSHeaderWrapper signedHeaders = getValidDGWSHeaders(flowId); // see above RegistryResponseType response = port.documentRegistryRegisterOnDemandDocumentEntry( request, signedHeaders.getSecurityHeader(), new Holder<Header>(signedHeaders.getMedcomHeader())); |
...