Skip to content

Commit

Permalink
Merge pull request #33 from SoftmedTanzania/new_payloads
Browse files Browse the repository at this point in the history
extending the payload to adopt the new design
  • Loading branch information
danfordnchembi committed Nov 3, 2021
2 parents e7e1166 + 38d260d commit a850bb6
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,23 @@ public static class Item {
private String placeOfDeathId;

/**
* ICD 10 preferred but other codes will be accepted as long as they are mapped to ICD10.Codes will be comma separated
* The ICD10 code for the cause of death
*/
@JsonProperty("icd10Code")
private String icd10Code;
@JsonProperty("causeOfDeath")
private String causeOfDeath;

/**
*The ICD10 Code for the Immediate cause of death
*/
@JsonProperty("immediateCauseOfDeath")
private String immediateCauseOfDeath;

/**
* The ICD10 COde for the Underlying cause of death
*/
@JsonProperty("underlyingCauseOfDeath")
private String underlyingCauseOfDeath;


/**
* Gender of the patient
Expand Down Expand Up @@ -100,14 +113,6 @@ public void setPlaceOfDeathId(String placeOfDeathId) {
this.placeOfDeathId = placeOfDeathId;
}

public String getIcd10Code() {
return icd10Code;
}

public void setIcd10Code(String icd10Code) {
this.icd10Code = icd10Code;
}

public String getGender() {
return gender;
}
Expand All @@ -131,5 +136,29 @@ public String getDateDeathOccurred() {
public void setDateDeathOccurred(String dateDeathOccurred) {
this.dateDeathOccurred = dateDeathOccurred;
}

public String getCauseOfDeath() {
return causeOfDeath;
}

public void setCauseOfDeath(String causeOfDeath) {
this.causeOfDeath = causeOfDeath;
}

public String getImmediateCauseOfDeath() {
return immediateCauseOfDeath;
}

public void setImmediateCauseOfDeath(String immediateCauseOfDeath) {
this.immediateCauseOfDeath = immediateCauseOfDeath;
}

public String getUnderlyingCauseOfDeath() {
return underlyingCauseOfDeath;
}

public void setUnderlyingCauseOfDeath(String underlyingCauseOfDeath) {
this.underlyingCauseOfDeath = underlyingCauseOfDeath;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,22 @@ public static class Item {
private String lastName;

/**
* ICD 10 preferred but other codes will be accepted as long as they are mapped to ICD10.Codes will be comma separated
* The ICD10 code for the cause of death
*/
@JsonProperty("icd10Code")
private String icd10Code;
@JsonProperty("causeOfDeath")
private String causeOfDeath;

/**
*The ICD10 Code for the Immediate cause of death
*/
@JsonProperty("immediateCauseOfDeath")
private String immediateCauseOfDeath;

/**
* The ICD10 COde for the Underlying cause of death
*/
@JsonProperty("underlyingCauseOfDeath")
private String underlyingCauseOfDeath;

/**
* Gender of the patient
Expand Down Expand Up @@ -158,14 +170,6 @@ public void setPatId(String patId) {
this.patId = patId;
}

public String getIcd10Code() {
return icd10Code;
}

public void setIcd10Code(String icd10Code) {
this.icd10Code = icd10Code;
}

public String getGender() {
return gender;
}
Expand All @@ -189,5 +193,29 @@ public String getDateDeathOccurred() {
public void setDateDeathOccurred(String dateDeathOccurred) {
this.dateDeathOccurred = dateDeathOccurred;
}

public String getCauseOfDeath() {
return causeOfDeath;
}

public void setCauseOfDeath(String causeOfDeath) {
this.causeOfDeath = causeOfDeath;
}

public String getImmediateCauseOfDeath() {
return immediateCauseOfDeath;
}

public void setImmediateCauseOfDeath(String immediateCauseOfDeath) {
this.immediateCauseOfDeath = immediateCauseOfDeath;
}

public String getUnderlyingCauseOfDeath() {
return underlyingCauseOfDeath;
}

public void setUnderlyingCauseOfDeath(String underlyingCauseOfDeath) {
this.underlyingCauseOfDeath = underlyingCauseOfDeath;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static class Item {
* Custom medical service codes must be mapped to standard CPT4 codes.
*/
@JsonProperty("medSvcCode")
private String medSvcCode;
private List<String> medSvcCode;

/**
* Coded identifier of the source of the revenue associated with this financial transaction.
Expand Down Expand Up @@ -153,11 +153,11 @@ public void setDob(String dob) {
this.dob = dob;
}

public String getMedSvcCode() {
public List<String> getMedSvcCode() {
return medSvcCode;
}

public void setMedSvcCode(String medSvcCode) {
public void setMedSvcCode(List<String> medSvcCode) {
this.medSvcCode = medSvcCode;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,27 @@ public static class Item {
* The unique identifier of the medical services provided. They should be comma separated (e.g. 002923, 00277, 002772)
*/
@JsonProperty("medSvcCode")
private String medSvcCode;
private List<String> medSvcCode;

/**
* The unique identifier of the diagnosed diseases. Should be comma separated (e.g. A17.8, M60.1, B29)
* The unique identifier of the confirmed diagnosed diseases.
*/
@JsonProperty("icd10Code")
private String icd10Code;
@JsonProperty("confirmedDiagnosis")
private List<String> confirmedDiagnosis;


/**
* The unique identifier of the differential diagnosed diseases.
*/
@JsonProperty("differentialDiagnosis")
private List<String> differentialDiagnosis;


/**
* The unique identifier of the provisional diagnosed diseases.
*/
@JsonProperty("provisionalDiagnosis")
private List<String> provisionalDiagnosis;

/**
* For in-patient records, the date the service was provided. For out-patient records, this should be the date of the visit.
Expand Down Expand Up @@ -147,20 +161,36 @@ public void setDob(String dob) {
this.dob = dob;
}

public String getMedSvcCode() {
public List<String> getMedSvcCode() {
return medSvcCode;
}

public void setMedSvcCode(String medSvcCode) {
public void setMedSvcCode(List<String> medSvcCode) {
this.medSvcCode = medSvcCode;
}

public String getIcd10Code() {
return icd10Code;
public List<String> getConfirmedDiagnosis() {
return confirmedDiagnosis;
}

public void setConfirmedDiagnosis(List<String> confirmedDiagnosis) {
this.confirmedDiagnosis = confirmedDiagnosis;
}

public List<String> getDifferentialDiagnosis() {
return differentialDiagnosis;
}

public void setDifferentialDiagnosis(List<String> differentialDiagnosis) {
this.differentialDiagnosis = differentialDiagnosis;
}

public List<String> getProvisionalDiagnosis() {
return provisionalDiagnosis;
}

public void setIcd10Code(String icd10Code) {
this.icd10Code = icd10Code;
public void setProvisionalDiagnosis(List<String> provisionalDiagnosis) {
this.provisionalDiagnosis = provisionalDiagnosis;
}

public String getServiceDate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ protected List<ResultDetail> validateData(Object receivedMessage) {
if (StringUtils.isBlank(item.getPlaceOfDeathId()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "placeOfDeathId"), null));

// if (StringUtils.isBlank(item.getIcd10Code()))
// results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "icd10Code"), null));
if (StringUtils.isBlank(item.getCauseOfDeath()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "causeOfDeath"), null));

if (StringUtils.isBlank(item.getDeathId()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "deathId"), null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ protected List<ResultDetail> validateData(Object receivedMessage) {
if (StringUtils.isBlank(item.getWardName()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "wardName"), null));

// if (StringUtils.isBlank(item.getIcd10Code()))
// results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "icd10Code"), null));
if (StringUtils.isBlank(item.getCauseOfDeath()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "causeOfDeath"), null));

if (StringUtils.isBlank(item.getUnderlyingCauseOfDeath()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "underlyingCauseOfDeath"), null));

if (StringUtils.isBlank(item.getWardId()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "wardId"), null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ protected List<ResultDetail> validateData(Object receivedObject) {

if (revenueReceivedRequest.getItems() != null) {
for (RevenueReceivedRequest.Item item : revenueReceivedRequest.getItems()) {

if (StringUtils.isBlank(item.getSystemTransId()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "systemTransId"), null));

Expand All @@ -66,7 +67,7 @@ protected List<ResultDetail> validateData(Object receivedObject) {
if (StringUtils.isBlank(item.getDob()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "dob"), null));

if (StringUtils.isBlank(item.getMedSvcCode()))
if (item.getMedSvcCode() == null || item.getMedSvcCode().isEmpty())
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "medSvcCode"), null));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,9 @@ protected List<ResultDetail> validateData(Object receivedObject) {
if (StringUtils.isBlank(item.getDob()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "dob"), null));

if (StringUtils.isBlank(item.getMedSvcCode()))
if (item.getMedSvcCode() == null || item.getMedSvcCode().isEmpty())
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "medSvcCode"), null));

// if (StringUtils.isBlank(item.getIcd10Code()))
// results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "icd10Code"), null));

if (StringUtils.isBlank(item.getServiceDate()))
results.add(new ResultDetail(ResultDetail.ResultsDetailsType.ERROR, String.format(errorMessageResource.getString("NN_ERR01"), "serviceDate"), null));

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/mediator.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ mediator.heartbeats=true
# == OpenHIM Core Properties == #
core.host=localhost
core.api.port=8080
core.api.user=username
core.api.password=password
core.api.user=him-user
core.api.password=him-password

# == Set the HDR Host, port and number == #
hdr.host=localhost
Expand Down
Loading

0 comments on commit a850bb6

Please sign in to comment.