Repository navigation
Changes in truenat updated workflow STOP-756 #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9284a58
c4883a3
4c417d3
fab0252
e1f702d
6192278
e40ac81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.iemr.flw.dto; | ||
|
|
||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| /** One test's result on an order: the order's own test, or MDR_RIF on an MTB/MTB_PLUS order. */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| public class DiagnosticResultItemDto { | ||
|
|
||
| // XRAY_CHEST, MTB, MTB_PLUS or MDR_RIF | ||
| private String resultType; | ||
| private String providerStatus; | ||
| private String resultSummary; | ||
| private Boolean tbPresence; | ||
| private Double tbConfidence; | ||
| // MDR_RIF only: true = DR TB, false = Non DR TB, null = not done / indeterminate | ||
| private Boolean drugResistancePresence; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package com.iemr.flw.integration.provider; | ||
|
|
||
| import com.iemr.flw.masterEnum.DiagnosticOrderType; | ||
|
|
||
| /** | ||
| * How a TrueNat (MTB / MTB_PLUS) order's two results are read, shared by the vendor poll and | ||
| * manual entry so both store the same thing. One order carries both tests: the MTB result itself, | ||
| * and an MDR RIF result that is only run when MTB comes back positive. | ||
| */ | ||
| public final class TrueNatResultRules { | ||
|
|
||
| public static final String SUMMARY_TB_POSITIVE = "TB Positive"; | ||
| public static final String SUMMARY_TB_NEGATIVE = "TB Negative"; | ||
| public static final String SUMMARY_DR_TB = "DR TB"; | ||
| public static final String SUMMARY_NON_DR_TB = "Non DR TB"; | ||
|
|
||
| private TrueNatResultRules() { | ||
| } | ||
|
|
||
| public static boolean isTrueNat(String orderType) { | ||
| return DiagnosticOrderType.MTB.name().equals(orderType) || DiagnosticOrderType.MTB_PLUS.name().equals(orderType); | ||
| } | ||
|
|
||
| /** A positive MTB result is followed by an MDR RIF test on the same order. */ | ||
| public static boolean needsMdrRif(String mtbSummary) { | ||
| return mtbSummary != null && SUMMARY_TB_POSITIVE.equalsIgnoreCase(mtbSummary.trim()); | ||
| } | ||
|
|
||
| /** TB presence from the MTB result; null for non-TrueNat orders or an unknown/error summary. */ | ||
| public static Boolean classifyTbPresence(String orderType, String summary) { | ||
| if (!isTrueNat(orderType) || summary == null) { | ||
| return null; | ||
|
Check failure on line 32 in src/main/java/com/iemr/flw/integration/provider/TrueNatResultRules.java
|
||
| } | ||
| if (SUMMARY_TB_POSITIVE.equalsIgnoreCase(summary.trim())) { | ||
| return true; | ||
| } | ||
| if (SUMMARY_TB_NEGATIVE.equalsIgnoreCase(summary.trim())) { | ||
| return false; | ||
| } | ||
| return null; | ||
|
Check failure on line 40 in src/main/java/com/iemr/flw/integration/provider/TrueNatResultRules.java
|
||
| } | ||
|
|
||
| /** Rifampicin resistance from the MDR RIF result; null when there is none or it is indeterminate. */ | ||
| public static Boolean classifyDrugResistance(String summary) { | ||
| if (summary == null) { | ||
| return null; | ||
|
Check failure on line 46 in src/main/java/com/iemr/flw/integration/provider/TrueNatResultRules.java
|
||
| } | ||
| if (SUMMARY_DR_TB.equalsIgnoreCase(summary.trim())) { | ||
| return true; | ||
| } | ||
| if (SUMMARY_NON_DR_TB.equalsIgnoreCase(summary.trim())) { | ||
| return false; | ||
| } | ||
| return null; | ||
|
Check failure on line 54 in src/main/java/com/iemr/flw/integration/provider/TrueNatResultRules.java
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.