Skip to content

Commit

Permalink
Merge pull request #75 from onc-healthit/netkraft-patch-SITE-3748
Browse files Browse the repository at this point in the history
Related Person TemplateIds Comparison
  • Loading branch information
jwspcc authored Aug 1, 2024
2 parents 6b416ec + 61d3d36 commit abab007
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ public class CCDAParticipant {
private String participantTypeCode;
private CCDAPlayingEntity participantRolePlayingEntity;
private CCDAAddress participantRoleAddress;
private ArrayList<CCDAII> templateId;
private ArrayList<CCDAII> templateIds;
private CCDAEffTime effectiveTime;
private CCDAAssociatedEntity associatedEntity;

public void log()
{
log.info(" *** Participant ***");

for(int j = 0; j < templateId.size(); j++) {
log.info(" Tempalte Id [" + j + "] = " + templateId.get(j).getRootValue());
log.info(" Tempalte Id Ext [" + j + "] = " + templateId.get(j).getExtValue());
for(int j = 0; j < templateIds.size(); j++) {
log.info(" Tempalte Id [" + j + "] = " + templateIds.get(j).getRootValue());
log.info(" Tempalte Id Ext [" + j + "] = " + templateIds.get(j).getExtValue());
}


Expand All @@ -53,7 +53,7 @@ public void log()

public CCDAParticipant()
{
templateId = new ArrayList<>();
templateIds = new ArrayList<>();
}

public CCDAAssignedEntity getAssignedEntity() {
Expand Down Expand Up @@ -104,12 +104,12 @@ public void setPlayingEntity(CCDAPlayingEntity playingEntity) {
this.participantRolePlayingEntity = playingEntity;
}

public ArrayList<CCDAII> getTemplateId() {
return templateId;
public ArrayList<CCDAII> getTemplateIds() {
return templateIds;
}

public void setTemplateId(ArrayList<CCDAII> templateId) {
this.templateId = templateId;
public void setTemplateIds(ArrayList<CCDAII> templateIds) {
this.templateIds = templateIds;
}

public CCDAEffTime getEffectiveTime() {
Expand Down Expand Up @@ -161,6 +161,7 @@ private static void checkForParticipantInSubmitted(CCDAParticipant ref, ArrayLis

for(CCDAParticipant sub : subParts) {
if(sub.checkForAssociatedEntity(ref.getAssociatedEntity())) {
ParserUtilities.compareTemplateIds(ref.getTemplateIds(), sub.getTemplateIds(), results, "Related Person TemplateId Comparison");
found = true;
break;
}
Expand All @@ -181,7 +182,6 @@ private static void checkForParticipantInSubmitted(CCDAParticipant ref, ArrayLis
if(ref.getAssociatedEntity().getLastName() != null)
lname = ref.getAssociatedEntity().getLastName().getValue();


// Error
String error = "The scenario contains RelatedPerson data with Relationship:, lastName: , firstName: " +
relationship + ", " +
Expand All @@ -198,36 +198,33 @@ private static void checkForParticipantInSubmitted(CCDAParticipant ref, ArrayLis
private boolean checkForAssociatedEntity(CCDAAssociatedEntity ref) {

if(ref.getAssociatedEntityCode() != null &&
ref.getAssociatedEntityCode().getCode() != null &&
this.getAssociatedEntity() != null &&
this.getAssociatedEntity().getAssociatedEntityCode() != null &&
this.getAssociatedEntity().getAssociatedEntityCode().getCode() != null &&
ref.getAssociatedEntityCode().getCode().equalsIgnoreCase(this.getAssociatedEntity().getAssociatedEntityCode().getCode()) &&
ref.getFirstName() != null &&
ref.getFirstName().getValue() != null &&
this.getAssociatedEntity().getFirstName() != null &&
this.getAssociatedEntity().getFirstName().getValue() != null &&
ref.getFirstName().getValue().equalsIgnoreCase(this.getAssociatedEntity().getFirstName().getValue()) &&
ref.getLastName() != null &&
ref.getLastName().getValue() != null &&
this.getAssociatedEntity().getLastName() != null &&
this.getAssociatedEntity().getLastName().getValue() != null &&
ref.getLastName().getValue().equalsIgnoreCase(this.getAssociatedEntity().getLastName().getValue()) &&

(
ref.getAssociatedEntityCode().getCode() != null &&
this.getAssociatedEntity() != null &&
this.getAssociatedEntity().getAssociatedEntityCode() != null &&
this.getAssociatedEntity().getAssociatedEntityCode().getCode() != null &&
ref.getAssociatedEntityCode().getCode().equalsIgnoreCase(this.getAssociatedEntity().getAssociatedEntityCode().getCode()) &&
ref.getFirstName() != null &&
ref.getFirstName().getValue() != null &&
this.getAssociatedEntity().getFirstName() != null &&
this.getAssociatedEntity().getFirstName().getValue() != null &&
ref.getFirstName().getValue().equalsIgnoreCase(this.getAssociatedEntity().getFirstName().getValue()) &&
ref.getLastName() != null &&
ref.getLastName().getValue() != null &&
this.getAssociatedEntity().getLastName() != null &&
this.getAssociatedEntity().getLastName().getValue() != null &&
ref.getLastName().getValue().equalsIgnoreCase(this.getAssociatedEntity().getLastName().getValue()) ||
(
this.getAssociatedEntity().getName() != null &&
this.getAssociatedEntity().getName().getValue() != null &&
(this.getAssociatedEntity().getName().getValue().contains(ref.getFirstName().getValue()) ||
this.getAssociatedEntity().getName().getValue().contains(ref.getLastName().getValue())
(
this.getAssociatedEntity().getName().getValue().contains(ref.getFirstName().getValue()) &&
this.getAssociatedEntity().getName().getValue().contains(ref.getLastName().getValue())
)
))
)
)
{
return true;
}
return false;
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static ArrayList<CCDAParticipant> readRelatedPerson(NodeList nodeList) t
part.setAssociatedEntity(new CCDAAssociatedEntity());

//set template id
part.setTemplateId(ParserUtilities.readTemplateIdList((NodeList)CCDAConstants.REL_TEMPLATE_ID_EXP.evaluate(nd,XPathConstants.NODESET)));
part.setTemplateIds(ParserUtilities.readTemplateIdList((NodeList)CCDAConstants.REL_TEMPLATE_ID_EXP.evaluate(nd,XPathConstants.NODESET)));

part.getAssociatedEntity().setAssociatedEntityCode(ParserUtilities.readCode((Element) CCDAConstants.REL_ASSOCIATED_CODE_EXP.
evaluate(nd, XPathConstants.NODE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ public static ArrayList<CCDAParticipant> readParticipant(Element policyActivityE
Element partNodeElement = (Element) partNodeList.item(i);
part = new CCDAParticipant();

part.setTemplateId(ParserUtilities.readTemplateIdList((NodeList) CCDAConstants.REL_TEMPLATE_ID_EXP.
part.setTemplateIds(ParserUtilities.readTemplateIdList((NodeList) CCDAConstants.REL_TEMPLATE_ID_EXP.
evaluate(partNodeElement, XPathConstants.NODESET)));

// Get Type code
Expand Down

0 comments on commit abab007

Please sign in to comment.