@Test public void testCreatePatientConsentXACMLPolicy_when_all_list_are_empty() throws SAXException, IOException { String result=xACMLPolicyProviderForCDA.createPatientConsentXACMLPolicy(new OrganizationPolicy(), null, null, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>()); assertXMLEqual(result,"<?xml version=\"1.0\" encoding=\"UTF-8\"?><PolicySet xmlns=\"urn:oasis:names:tc:xacml:2.0:policy:schema:os\" xmlns:xsi=\"http: }
public String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions) { String res = ""; createPolicySetHeader(patientId, orgPolicy.getHomeCommunityId()); createPolicyHeader(); createPolicyTarget(); createRuleAuthorization(); createRuleAllowedPOU(allowedPOU); createRuleAllowedRecipients(allowedRecipients); createRuleRequiredSensitivityPermissions(maskingActions); createEndPolicy(); if (!redactActions.isEmpty()) { createObligationPolicyRedact(redactActions); } if (!maskingActions.isEmpty()) { createObligationPolicyMask(maskingActions); } this.orgLaw.clear(); this.refrainPolicy.clear(); this.documentHandling.clear(); getOrganizationalPolicyTags(orgPolicy, "USPrivacyLaw"); getOrganizationalPolicyTags(orgPolicy, "RefrainPolicy"); getOrganizationalPolicyTags(orgPolicy, "DocumentHandling"); if (!this.orgLaw.isEmpty()) { createObligationPolicyUSPrivacyLaw(); } if (!this.refrainPolicy.isEmpty()) { createObligationPolicyRefrain(); } if (!this.documentHandling.isEmpty()) { createObligationPolicyDocumentHandling(); } createRuleEmergency(); createEndPolicySet(); res = this.buffer.toString(); return res; }
XACMLPolicyProviderForCDA { public String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions) { String res = ""; createPolicySetHeader(patientId, orgPolicy.getHomeCommunityId()); createPolicyHeader(); createPolicyTarget(); createRuleAuthorization(); createRuleAllowedPOU(allowedPOU); createRuleAllowedRecipients(allowedRecipients); createRuleRequiredSensitivityPermissions(maskingActions); createEndPolicy(); if (!redactActions.isEmpty()) { createObligationPolicyRedact(redactActions); } if (!maskingActions.isEmpty()) { createObligationPolicyMask(maskingActions); } this.orgLaw.clear(); this.refrainPolicy.clear(); this.documentHandling.clear(); getOrganizationalPolicyTags(orgPolicy, "USPrivacyLaw"); getOrganizationalPolicyTags(orgPolicy, "RefrainPolicy"); getOrganizationalPolicyTags(orgPolicy, "DocumentHandling"); if (!this.orgLaw.isEmpty()) { createObligationPolicyUSPrivacyLaw(); } if (!this.refrainPolicy.isEmpty()) { createObligationPolicyRefrain(); } if (!this.documentHandling.isEmpty()) { createObligationPolicyDocumentHandling(); } createRuleEmergency(); createEndPolicySet(); res = this.buffer.toString(); return res; } }
XACMLPolicyProviderForCDA { public String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions) { String res = ""; createPolicySetHeader(patientId, orgPolicy.getHomeCommunityId()); createPolicyHeader(); createPolicyTarget(); createRuleAuthorization(); createRuleAllowedPOU(allowedPOU); createRuleAllowedRecipients(allowedRecipients); createRuleRequiredSensitivityPermissions(maskingActions); createEndPolicy(); if (!redactActions.isEmpty()) { createObligationPolicyRedact(redactActions); } if (!maskingActions.isEmpty()) { createObligationPolicyMask(maskingActions); } this.orgLaw.clear(); this.refrainPolicy.clear(); this.documentHandling.clear(); getOrganizationalPolicyTags(orgPolicy, "USPrivacyLaw"); getOrganizationalPolicyTags(orgPolicy, "RefrainPolicy"); getOrganizationalPolicyTags(orgPolicy, "DocumentHandling"); if (!this.orgLaw.isEmpty()) { createObligationPolicyUSPrivacyLaw(); } if (!this.refrainPolicy.isEmpty()) { createObligationPolicyRefrain(); } if (!this.documentHandling.isEmpty()) { createObligationPolicyDocumentHandling(); } createRuleEmergency(); createEndPolicySet(); res = this.buffer.toString(); return res; }  }
XACMLPolicyProviderForCDA { public String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions) { String res = ""; createPolicySetHeader(patientId, orgPolicy.getHomeCommunityId()); createPolicyHeader(); createPolicyTarget(); createRuleAuthorization(); createRuleAllowedPOU(allowedPOU); createRuleAllowedRecipients(allowedRecipients); createRuleRequiredSensitivityPermissions(maskingActions); createEndPolicy(); if (!redactActions.isEmpty()) { createObligationPolicyRedact(redactActions); } if (!maskingActions.isEmpty()) { createObligationPolicyMask(maskingActions); } this.orgLaw.clear(); this.refrainPolicy.clear(); this.documentHandling.clear(); getOrganizationalPolicyTags(orgPolicy, "USPrivacyLaw"); getOrganizationalPolicyTags(orgPolicy, "RefrainPolicy"); getOrganizationalPolicyTags(orgPolicy, "DocumentHandling"); if (!this.orgLaw.isEmpty()) { createObligationPolicyUSPrivacyLaw(); } if (!this.refrainPolicy.isEmpty()) { createObligationPolicyRefrain(); } if (!this.documentHandling.isEmpty()) { createObligationPolicyDocumentHandling(); } createRuleEmergency(); createEndPolicySet(); res = this.buffer.toString(); return res; }  String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions); }
XACMLPolicyProviderForCDA { public String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions) { String res = ""; createPolicySetHeader(patientId, orgPolicy.getHomeCommunityId()); createPolicyHeader(); createPolicyTarget(); createRuleAuthorization(); createRuleAllowedPOU(allowedPOU); createRuleAllowedRecipients(allowedRecipients); createRuleRequiredSensitivityPermissions(maskingActions); createEndPolicy(); if (!redactActions.isEmpty()) { createObligationPolicyRedact(redactActions); } if (!maskingActions.isEmpty()) { createObligationPolicyMask(maskingActions); } this.orgLaw.clear(); this.refrainPolicy.clear(); this.documentHandling.clear(); getOrganizationalPolicyTags(orgPolicy, "USPrivacyLaw"); getOrganizationalPolicyTags(orgPolicy, "RefrainPolicy"); getOrganizationalPolicyTags(orgPolicy, "DocumentHandling"); if (!this.orgLaw.isEmpty()) { createObligationPolicyUSPrivacyLaw(); } if (!this.refrainPolicy.isEmpty()) { createObligationPolicyRefrain(); } if (!this.documentHandling.isEmpty()) { createObligationPolicyDocumentHandling(); } createRuleEmergency(); createEndPolicySet(); res = this.buffer.toString(); return res; }  String createPatientConsentXACMLPolicy(OrganizationPolicy orgPolicy, String patientId, String authorization, List<String> allowedPOU, List<String> allowedRecipients, List<String> redactActions, List<String> maskingActions);  }