From 1b2be33241491a975761e2c75df38d1f815352fe Mon Sep 17 00:00:00 2001 From: Anjana Date: Fri, 7 Jul 2023 17:58:03 +0530 Subject: [PATCH 01/26] API cleanup --- .../teleconsultation/TeleConsultationController.java | 4 ++-- .../iemr/hwc/controller/version/VersionController.java | 3 +++ .../videoconsultation/VideoConsultationController.java | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/iemr/hwc/controller/teleconsultation/TeleConsultationController.java b/src/main/java/com/iemr/hwc/controller/teleconsultation/TeleConsultationController.java index ee782904..a92218b4 100644 --- a/src/main/java/com/iemr/hwc/controller/teleconsultation/TeleConsultationController.java +++ b/src/main/java/com/iemr/hwc/controller/teleconsultation/TeleConsultationController.java @@ -113,7 +113,7 @@ public String checkBeneficiaryStatusToProceedWithSpecialist(@RequestBody String } @CrossOrigin - @ApiOperation(value = "Create tele consultation request from worklist whose visit is created", consumes = "application/json", produces = "application/json") + @ApiOperation(value = "Create teleconsultation request from worklist", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/create/benTCRequestWithVisitCode" }, method = { RequestMethod.POST }) public String createTCRequestForBeneficiary(@RequestBody String requestOBJ, @RequestHeader String Authorization) { OutputResponse response = new OutputResponse(); @@ -140,7 +140,7 @@ public String createTCRequestForBeneficiary(@RequestBody String requestOBJ, @Req // TC request List @CrossOrigin - @ApiOperation(value = "Get tele consultation request list for a specialist", consumes = "application/json", produces = "application/json") + @ApiOperation(value = "Get teleconsultation request list for a specialist", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/getTCRequestList" }, method = { RequestMethod.POST }) public String getTCSpecialistWorkListNew(@RequestBody String requestOBJ) { OutputResponse response = new OutputResponse(); diff --git a/src/main/java/com/iemr/hwc/controller/version/VersionController.java b/src/main/java/com/iemr/hwc/controller/version/VersionController.java index 3624cac4..79cef880 100644 --- a/src/main/java/com/iemr/hwc/controller/version/VersionController.java +++ b/src/main/java/com/iemr/hwc/controller/version/VersionController.java @@ -35,12 +35,15 @@ import com.iemr.hwc.utils.response.OutputResponse; +import io.swagger.annotations.ApiOperation; + @RestController public class VersionController { private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); @CrossOrigin() + @ApiOperation(value = "Get version information", produces = "application/json") @RequestMapping(value = "/version", method = { RequestMethod.GET }) public String versionInformation() { OutputResponse output = new OutputResponse(); diff --git a/src/main/java/com/iemr/hwc/controller/videoconsultation/VideoConsultationController.java b/src/main/java/com/iemr/hwc/controller/videoconsultation/VideoConsultationController.java index c7c5cca1..3d7a4e12 100644 --- a/src/main/java/com/iemr/hwc/controller/videoconsultation/VideoConsultationController.java +++ b/src/main/java/com/iemr/hwc/controller/videoconsultation/VideoConsultationController.java @@ -33,6 +33,8 @@ import com.iemr.hwc.service.videoconsultation.VideoConsultationService; import com.iemr.hwc.utils.response.OutputResponse; +import io.swagger.annotations.ApiOperation; + @RestController @RequestMapping(value = "/videoConsultation", headers = "Authorization") public class VideoConsultationController { @@ -43,6 +45,7 @@ public class VideoConsultationController { private VideoConsultationService videoConsultationService; @CrossOrigin() + @ApiOperation(value = "Login to video consultation service", produces = "application/json") @RequestMapping(value = "/login/{userID}", headers = "Authorization", method = { RequestMethod.GET }, produces = { "application/json" }) public String login(@PathVariable("userID") Long userID) { @@ -65,6 +68,7 @@ public String login(@PathVariable("userID") Long userID) { } @CrossOrigin() + @ApiOperation(value = "Call user for video consultation", produces = "application/json") @RequestMapping(value = "/call/{fromUserID}/{touserID}", headers = "Authorization", method = { RequestMethod.GET }, produces = { "application/json" }) public String call(@PathVariable("fromUserID") Long fromUserID, @PathVariable("toUserID") Long toUserID) { @@ -87,6 +91,7 @@ public String call(@PathVariable("fromUserID") Long fromUserID, @PathVariable("t } @CrossOrigin() + @ApiOperation(value = "Video consultatation for users by passing type", produces = "application/json") @RequestMapping(value = "/call/{fromUserID}/{toUserID}/{type}", headers = "Authorization", method = { RequestMethod.GET }, produces = { "application/json" }) public String callSwymedAndJitsi(@PathVariable("fromUserID") Long fromUserID, @@ -114,6 +119,7 @@ public String callSwymedAndJitsi(@PathVariable("fromUserID") Long fromUserID, } @CrossOrigin() + @ApiOperation(value = "Call van through Swymed", produces = "application/json") @RequestMapping(value = "/callvan/{fromUserID}/{vanID}", headers = "Authorization", method = { RequestMethod.GET }, produces = { "application/json" }) public String callvan(@PathVariable("fromUserID") Long fromUserID, @PathVariable("vanID") Integer vanID) { @@ -136,6 +142,7 @@ public String callvan(@PathVariable("fromUserID") Long fromUserID, @PathVariable } @CrossOrigin() + @ApiOperation(value = "Call van through Swymed by passing type", produces = "application/json") @RequestMapping(value = "/callvan/{fromUserID}/{vanID}/{type}", headers = "Authorization", method = { RequestMethod.GET }, produces = { "application/json" }) public String callVanSwymedAndJitsi(@PathVariable("fromUserID") Long fromUserID, @@ -164,6 +171,7 @@ public String callVanSwymedAndJitsi(@PathVariable("fromUserID") Long fromUserID, } @CrossOrigin() + @ApiOperation(value = "Logout of video consultation service", produces = "application/json") @RequestMapping(value = "/logout", headers = "Authorization", method = { RequestMethod.GET }, produces = { "application/json" }) public String logout() { From 2029a5f6fa87cb9238bd73cd3b70026e20771f97 Mon Sep 17 00:00:00 2001 From: Anjana Date: Mon, 10 Jul 2023 15:07:37 +0530 Subject: [PATCH 02/26] API clean up --- .../iemr/hwc/controller/report/CRMReportController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/iemr/hwc/controller/report/CRMReportController.java b/src/main/java/com/iemr/hwc/controller/report/CRMReportController.java index 009f4a17..ea23e4ce 100644 --- a/src/main/java/com/iemr/hwc/controller/report/CRMReportController.java +++ b/src/main/java/com/iemr/hwc/controller/report/CRMReportController.java @@ -40,6 +40,8 @@ import com.iemr.hwc.service.report.CRMReportService; import com.iemr.hwc.utils.response.OutputResponse; +import io.swagger.annotations.ApiOperation; + @RequestMapping("/TMReport") @RestController public class CRMReportController { @@ -50,6 +52,7 @@ public class CRMReportController { private CRMReportService cRMReportService; @CrossOrigin() + @ApiOperation(value = "Fetch chief complaints report", consumes = "application/json", produces = "application/json") @RequestMapping(value = "/chiefcomplaintreport", headers = "Authorization", method = { RequestMethod.POST }, produces = { "application/json" }) public String chiefcomplaintreport(@RequestBody ReportInput input) { @@ -71,6 +74,7 @@ public String chiefcomplaintreport(@RequestBody ReportInput input) { } @CrossOrigin() + @ApiOperation(value = "Fetch consultation report", consumes = "application/json", produces = "application/json") @RequestMapping(value = "/ConsultationReport", headers = "Authorization", method = { RequestMethod.POST }, produces = { "application/json" }) public String getConsultationReport(@RequestBody ReportInput input) { @@ -92,6 +96,7 @@ public String getConsultationReport(@RequestBody ReportInput input) { } @CrossOrigin() + @ApiOperation(value = "Fetch total consultation report", consumes = "application/json", produces = "application/json") @RequestMapping(value = "/TotalConsultationReport", headers = "Authorization", method = { RequestMethod.POST }, produces = { "application/json" }) public String getTotalConsultationReport(@RequestBody ReportInput input) { @@ -113,6 +118,7 @@ public String getTotalConsultationReport(@RequestBody ReportInput input) { } @CrossOrigin() + @ApiOperation(value = "Fetch monthly report", consumes = "application/json", produces = "application/json") @RequestMapping(value = "/MonthlyReport", headers = "Authorization", method = { RequestMethod.POST }, produces = { "application/json" }) public String getMonthlyReport(@RequestBody ReportInput input) { @@ -134,6 +140,7 @@ public String getMonthlyReport(@RequestBody ReportInput input) { } @CrossOrigin() + @ApiOperation(value = "Fetch daily report", consumes = "application/json", produces = "application/json") @RequestMapping(value = "/DailyReport", headers = "Authorization", method = { RequestMethod.POST }, produces = { "application/json" }) public String getDailyReport(@RequestBody ReportInput input) { From dabc3e370f2023b6f8ff886efb6c1d4e75887727 Mon Sep 17 00:00:00 2001 From: Anjana Date: Fri, 1 Sep 2023 15:15:32 +0530 Subject: [PATCH 03/26] Renaming controller classes --- ...cenceController.java => ChildhoodAdolescenceController.java} | 2 +- ...roller.java => DiabetesHypertensionScreeningController.java} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/main/java/com/iemr/hwc/controller/adolescent/{ChildhoodAndAdolescenceController.java => ChildhoodAdolescenceController.java} (99%) rename src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/{DiabetesAndHypertensionScreeningController.java => DiabetesHypertensionScreeningController.java} (98%) diff --git a/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAndAdolescenceController.java b/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java similarity index 99% rename from src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAndAdolescenceController.java rename to src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java index bf523ef8..6d12510a 100644 --- a/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAndAdolescenceController.java +++ b/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java @@ -49,7 +49,7 @@ @CrossOrigin @RestController @RequestMapping(value = "/child-adolescent-care", headers = "Authorization") -public class ChildhoodAndAdolescenceController { +public class ChildhoodAdolescenceController { private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); @Autowired diff --git a/src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/DiabetesAndHypertensionScreeningController.java b/src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/DiabetesHypertensionScreeningController.java similarity index 98% rename from src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/DiabetesAndHypertensionScreeningController.java rename to src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/DiabetesHypertensionScreeningController.java index bcf0b318..47453275 100644 --- a/src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/DiabetesAndHypertensionScreeningController.java +++ b/src/main/java/com/iemr/hwc/controller/diabetesAndHypertensionOutcome/DiabetesHypertensionScreeningController.java @@ -39,7 +39,7 @@ @CrossOrigin @RestController @RequestMapping(value = "/screeningOutcome", headers = "Authorization") -public class DiabetesAndHypertensionScreeningController { +public class DiabetesHypertensionScreeningController { private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); @Autowired From d3b17b436d5dcd5a14be6aa75faaa5d8fc5a7295 Mon Sep 17 00:00:00 2001 From: Anjana Date: Wed, 13 Sep 2023 14:43:32 +0530 Subject: [PATCH 04/26] removing unwanted file --- ...- Application-classpathOnly-1693573232666.jar | Bin 2945 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .temp-hwc-facility-service - Application-classpathOnly-1693573232666.jar diff --git a/.temp-hwc-facility-service - Application-classpathOnly-1693573232666.jar b/.temp-hwc-facility-service - Application-classpathOnly-1693573232666.jar deleted file mode 100644 index 271580f4a1c8a23a29703909c85869f973fceb5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2945 zcmZ{mX*?5-AICRy&rA{XOUSv(#9X=OEJG%wh#WgiMDDZP!;oWPR>%>WJEWDQxr!9I z8gk!K3aO$0@Av5c`#<=W1h@sD;ui?lrRYRF5kc%ei&7Xp7bc_#NB2_&#veuJ=VcH94Jw&&gxN^uqmVdFZ{p0;gZ zjq!|!uR%dJ#R-|=k&8HPN{qh+Z4P;cxKr^2h|ai-WxqS6ry*`9|M3AlOmI$-khZFt z2f`GTg_?>ia3L4PcROc|=PPX-GxI*lU37p@BoIh`(=$(jkg!#{T1^p1H7a&UVAN0V zz46s=jz);_jOAJ~#h+X#_O7>3kk#K2xMk@>vZ+o_Bmsl>k2nY11H;pc937VUeipPy z%3y|C?>aGLy*n-sb2-ZBwID*4t}^Chj>+s)%=~Pcp+X00{U@J?bKKvfUN<%YPvR#` zsc+-9PM6ERKyK6}^LmJSWg;+t-TzH=MmL_o%2bVs_iOZ@M*3)Q5(oliT-Qnjy?UZ~ zp!bF%H!;xY9%T@k{GMc{XIT19Vgcf27u2icp}upNuW}w5#~EjUULPQ#h7%UB%9nOC;=xvBoS=OL^y>Y6nWXb>se zU?8KG92)8u5wwy=zD&-a-MB4aVRn1r0H+h@e)^fuujVNSp*nZ1+fh8|3>0^4FmH}E zyioVNNNtQgd_dlk9L?<>k#Z|Q!gLc>s!9W4oI)b}GN71%jLxb#I~!;*i^K!hUs-nI z8?+4n^u4h_TEea2c8ltDW#uzh_U+hW(e*O~G}blFYb0ac=n;?NtqyoZR-*2gmK3$< z`%}_Ox(ka_!aE&OzGOPOeHOB_)L-YKj@ldqDYB z=!K8oDdeNYC+^tGFq1aIHlKb3?1?o(Os=sbR_CpnO+ZB_V-zd6(3Rwv&;ibIvnpgw z$cOw2kKFb^7kckgk1@ujwR+*Vu0LP+@EEf>&->Iecl^&IzVV}!KlBvt7m>o22wL{g=r{O$m@LHks2Tl33SC+)hj z$23zHXQ80Bml&C0hND*HsJyYgYh z!%zIy8v7aN3bYkr*MhU$7JhVy9wjSuas(oaHOr685D!KRQE83oU7}-)Y0Co$f*AVR zFvg4)^T#z9B0P1tp)~H}@QO7n*FAS>q<9X-8&1fG9DDeJ+|HI~Iu(qsqx%yNNTisl4 zpuQrsE%s5-y9A0Kr)k}5@@X!AkuQpg6U=Gf0~&wJPYoSBMh9V@-5g$Ydoa*vYv=Vx zCx!pAW{HDT8U0T-ab^FMtGI_1DIw55^b4A7ZY);jSV7=(q>2rK_yf3%viiX82kC8jav(r~Q6XIiGsHE@P*>K4dS5FbSD#KUL^TtZQ7# z6s^YmCzpg)>6t?&#agG9<&Z_F7DUE&82{(4D;0#Si?Z7ckLVLf} zVY2LXAW=`V5;Qe9GkDx?J90b4aS(s3rm(7q^?5@Jdi#Cq^M{`w(?h#-9*BEZ1oT7} zj>e|5!zOj_z~T)Zh|1NMC8GFVUi@clSVK;!A{D&&I})l(y>^bSOq&XFKT(OfMB2WRLfO4( zIv-Go7jA-l=%<&HM$wvFdpv2K$Q+g6eM4tZCw?Qb!f;C<6okVYU|EQMcM$;jwRMiDayH4hZ4-Kg1~7mma5##IVOP8vXN#7n6?^5ZDV z9od)OuHssK+?ueHxLNr=sF{OQ_7W3J(FuGrr*lkthIZIu(aYU=&5*`7E`&G9#iBIT z7%7jNq#E{s<&shP>y$jEe(eOlou_A$T9On-wa$o$=+AH)P$L~5RY8g|{3Dif%X*Gj zPNv)e0cQwib+>Xw_pO?1==Ay!&OnC4Gy^6b81n?-@|wAHCE>i)-fmCRBT=U4L_o?i z6wJm8MUy27>qLjcSQ?Cx^aHMjt`c*lyE|Bhp~HICc5hJ6=`T#M0F^_jG(fa9rwXJzq>vn=>Sr<1 z@F~gJ7InoXW>-$)nypjv4G^=wqPDM6m%TZ{8Y;bX?DKkVBAhZjrIe_-u`E0_dBxMm z#OUxSli27erF$Tytm!7iQZC)x2=$P4CRB0V|J7J^@(q)Ley<}?@>%sL6FIv*vV{<% z&P37^Z=PiZ-E06A8$7G0_C>>y2M?XKk|zx9@>X}_+U!K!?O$+XH=3=hMGb<5TRHMU zS16VmU6*?k9AA5{wzlBL+=9GN{lHbrq`OjwP>dxHZ?qDjf0`cvpqv8$FqS|L5x{>n f`QP0?n*6`~KWWBTa&iB23H*D^|K9T8f6{*d*Li#= From 89581e99f485ea1d4f6bd52e8b2ebbf1476f649d Mon Sep 17 00:00:00 2001 From: Anjana KJ <134688551+Anjana2310@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:21:22 +0530 Subject: [PATCH 05/26] Removing unwanted file (#61) * API cleanup * API clean up * Renaming controller classes * removing unwanted file --- ...- Application-classpathOnly-1693573232666.jar | Bin 2945 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .temp-hwc-facility-service - Application-classpathOnly-1693573232666.jar diff --git a/.temp-hwc-facility-service - Application-classpathOnly-1693573232666.jar b/.temp-hwc-facility-service - Application-classpathOnly-1693573232666.jar deleted file mode 100644 index 271580f4a1c8a23a29703909c85869f973fceb5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2945 zcmZ{mX*?5-AICRy&rA{XOUSv(#9X=OEJG%wh#WgiMDDZP!;oWPR>%>WJEWDQxr!9I z8gk!K3aO$0@Av5c`#<=W1h@sD;ui?lrRYRF5kc%ei&7Xp7bc_#NB2_&#veuJ=VcH94Jw&&gxN^uqmVdFZ{p0;gZ zjq!|!uR%dJ#R-|=k&8HPN{qh+Z4P;cxKr^2h|ai-WxqS6ry*`9|M3AlOmI$-khZFt z2f`GTg_?>ia3L4PcROc|=PPX-GxI*lU37p@BoIh`(=$(jkg!#{T1^p1H7a&UVAN0V zz46s=jz);_jOAJ~#h+X#_O7>3kk#K2xMk@>vZ+o_Bmsl>k2nY11H;pc937VUeipPy z%3y|C?>aGLy*n-sb2-ZBwID*4t}^Chj>+s)%=~Pcp+X00{U@J?bKKvfUN<%YPvR#` zsc+-9PM6ERKyK6}^LmJSWg;+t-TzH=MmL_o%2bVs_iOZ@M*3)Q5(oliT-Qnjy?UZ~ zp!bF%H!;xY9%T@k{GMc{XIT19Vgcf27u2icp}upNuW}w5#~EjUULPQ#h7%UB%9nOC;=xvBoS=OL^y>Y6nWXb>se zU?8KG92)8u5wwy=zD&-a-MB4aVRn1r0H+h@e)^fuujVNSp*nZ1+fh8|3>0^4FmH}E zyioVNNNtQgd_dlk9L?<>k#Z|Q!gLc>s!9W4oI)b}GN71%jLxb#I~!;*i^K!hUs-nI z8?+4n^u4h_TEea2c8ltDW#uzh_U+hW(e*O~G}blFYb0ac=n;?NtqyoZR-*2gmK3$< z`%}_Ox(ka_!aE&OzGOPOeHOB_)L-YKj@ldqDYB z=!K8oDdeNYC+^tGFq1aIHlKb3?1?o(Os=sbR_CpnO+ZB_V-zd6(3Rwv&;ibIvnpgw z$cOw2kKFb^7kckgk1@ujwR+*Vu0LP+@EEf>&->Iecl^&IzVV}!KlBvt7m>o22wL{g=r{O$m@LHks2Tl33SC+)hj z$23zHXQ80Bml&C0hND*HsJyYgYh z!%zIy8v7aN3bYkr*MhU$7JhVy9wjSuas(oaHOr685D!KRQE83oU7}-)Y0Co$f*AVR zFvg4)^T#z9B0P1tp)~H}@QO7n*FAS>q<9X-8&1fG9DDeJ+|HI~Iu(qsqx%yNNTisl4 zpuQrsE%s5-y9A0Kr)k}5@@X!AkuQpg6U=Gf0~&wJPYoSBMh9V@-5g$Ydoa*vYv=Vx zCx!pAW{HDT8U0T-ab^FMtGI_1DIw55^b4A7ZY);jSV7=(q>2rK_yf3%viiX82kC8jav(r~Q6XIiGsHE@P*>K4dS5FbSD#KUL^TtZQ7# z6s^YmCzpg)>6t?&#agG9<&Z_F7DUE&82{(4D;0#Si?Z7ckLVLf} zVY2LXAW=`V5;Qe9GkDx?J90b4aS(s3rm(7q^?5@Jdi#Cq^M{`w(?h#-9*BEZ1oT7} zj>e|5!zOj_z~T)Zh|1NMC8GFVUi@clSVK;!A{D&&I})l(y>^bSOq&XFKT(OfMB2WRLfO4( zIv-Go7jA-l=%<&HM$wvFdpv2K$Q+g6eM4tZCw?Qb!f;C<6okVYU|EQMcM$;jwRMiDayH4hZ4-Kg1~7mma5##IVOP8vXN#7n6?^5ZDV z9od)OuHssK+?ueHxLNr=sF{OQ_7W3J(FuGrr*lkthIZIu(aYU=&5*`7E`&G9#iBIT z7%7jNq#E{s<&shP>y$jEe(eOlou_A$T9On-wa$o$=+AH)P$L~5RY8g|{3Dif%X*Gj zPNv)e0cQwib+>Xw_pO?1==Ay!&OnC4Gy^6b81n?-@|wAHCE>i)-fmCRBT=U4L_o?i z6wJm8MUy27>qLjcSQ?Cx^aHMjt`c*lyE|Bhp~HICc5hJ6=`T#M0F^_jG(fa9rwXJzq>vn=>Sr<1 z@F~gJ7InoXW>-$)nypjv4G^=wqPDM6m%TZ{8Y;bX?DKkVBAhZjrIe_-u`E0_dBxMm z#OUxSli27erF$Tytm!7iQZC)x2=$P4CRB0V|J7J^@(q)Ley<}?@>%sL6FIv*vV{<% z&P37^Z=PiZ-E06A8$7G0_C>>y2M?XKk|zx9@>X}_+U!K!?O$+XH=3=hMGb<5TRHMU zS16VmU6*?k9AA5{wzlBL+=9GN{lHbrq`OjwP>dxHZ?qDjf0`cvpqv8$FqS|L5x{>n f`QP0?n*6`~KWWBTa&iB23H*D^|K9T8f6{*d*Li#= From c5411e2de00a705a86c55b916de820f4378af78f Mon Sep 17 00:00:00 2001 From: Vidyadevi Salunkhe <84471226+Vidyaaa24@users.noreply.github.com> Date: Wed, 13 Sep 2023 18:29:26 +0530 Subject: [PATCH 06/26] workflow changes (#62) * Update and rename sast-and-package-prod.yml to package-prod.yml * Update package-prod.yml * Update package-prod.yml * Update and rename sast-and-package.yml to test-package.yml * Update test-package.yml * Update and rename test-package.yml to package-test.yml * Update package-test.yml * Update package-prod.yml * Update package-test.yml * Create codeql.yml * Update codeql.yml * Update codeql.yml * Update codeql.yml * Update codeql.yml * Update and rename package-test.yml to package.yml * Update codeql.yml * Update package.yml * Update package-prod.yml * Update package-prod.yml * Rename codeql.yml to sast.yml --------- Co-authored-by: Anjana KJ <134688551+Anjana2310@users.noreply.github.com> --- .github/workflows/package-prod.yml | 42 ++++++++++++++ .github/workflows/package.yml | 42 ++++++++++++++ .github/workflows/sast-and-package-prod.yml | 63 --------------------- .github/workflows/sast-and-package.yml | 55 ------------------ .github/workflows/sast.yml | 53 +++++++++++++++++ 5 files changed, 137 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/package-prod.yml create mode 100644 .github/workflows/package.yml delete mode 100644 .github/workflows/sast-and-package-prod.yml delete mode 100644 .github/workflows/sast-and-package.yml create mode 100644 .github/workflows/sast.yml diff --git a/.github/workflows/package-prod.yml b/.github/workflows/package-prod.yml new file mode 100644 index 00000000..f5482565 --- /dev/null +++ b/.github/workflows/package-prod.yml @@ -0,0 +1,42 @@ +name: Package-prod + +on: + push: + branches: [ "master"] + paths-ignore: + - target/** + - dist/** + pull_request: + branches: [ "master" ] + paths-ignore: + - target/** + - dist/** + +env: + ENV_VAR: prod + +jobs: + Package-prod: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup JDK 8 + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }} + + - name: Create WAR file + run: mvn -B package --file pom.xml + + - name: Upload WAR file as artifact + uses: actions/upload-artifact@v2 + with: + name: HWC-API + path: target/hwc-facility-service.war diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 00000000..4bc704e1 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,42 @@ +name: Package + +on: + push: + branches: [ "develop"] + paths-ignore: + - target/** + - dist/** + pull_request: + branches: [ "develop" ] + paths-ignore: + - target/** + - dist/** + +env: + ENV_VAR: test + +jobs: + Package-test: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup JDK 8 + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }} + + - name: Build WAR file + run: mvn -B package --file pom.xml + + - name: Upload WAR file as artifact + uses: actions/upload-artifact@v2 + with: + name: HWC-API + path: target/hwc-facility-service.war diff --git a/.github/workflows/sast-and-package-prod.yml b/.github/workflows/sast-and-package-prod.yml deleted file mode 100644 index d85b1528..00000000 --- a/.github/workflows/sast-and-package-prod.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Static Code Analysis and Packaging Prod -on: - push: - branches: [ "master"] -env: - ENV_VAR: prod - -jobs: - CodeQL: - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup JDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: 'adopt' - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: Java - - - name: Build with Maven - run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }} - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - languages: Java - - Packaging: - needs: codeql - runs-on: ubuntu-latest - steps: - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup JDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: 'adopt' - - - name: Create WAR file - run: mvn -B package --file pom.xml - - - name: Upload WAR file as artifact - uses: actions/upload-artifact@v2 - with: - name: HWC-API - path: target/hwc-facility-service.war diff --git a/.github/workflows/sast-and-package.yml b/.github/workflows/sast-and-package.yml deleted file mode 100644 index 196b648c..00000000 --- a/.github/workflows/sast-and-package.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Static Code Analysis and Packaging -on: - push: - branches: [ "develop" ] - -env: - ENV_VAR: test - -jobs: - CodeQL: - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Setup JDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: 'adopt' - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: Java - - name: Build with Maven - run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }} - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - - Packaging: - needs: codeql - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Setup JDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: 'adopt' - - name: Test with maven - run: mvn test - - name: Create WAR file - run: mvn -B package --file pom.xml - - name: Upload WAR file as artifact - uses: actions/upload-artifact@v2 - with: - name: HWC-API - path: target/hwc-facility-service.war diff --git a/.github/workflows/sast.yml b/.github/workflows/sast.yml new file mode 100644 index 00000000..c118ec3c --- /dev/null +++ b/.github/workflows/sast.yml @@ -0,0 +1,53 @@ +name: CodeQL + +on: + push: + branches: [ "develop" ] + paths-ignore: + - target/** + - dist/** + pull_request: + branches: [ "develop" ] + paths-ignore: + - target/** + - dist/** + +jobs: + analyze: + name: Analyze + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + + - name: Setup JDK 8 + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean install + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From 9fa025cc7a1ebae9ec2820eccf2024f0d7e562e0 Mon Sep 17 00:00:00 2001 From: Vidyadevi Salunkhe <84471226+Vidyaaa24@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:04:23 +0530 Subject: [PATCH 07/26] workflow changes (#63) * Update sast.yml * Delete .github/workflows directory * Create sast.yml * Add files via upload From 8f236e5f997dc0265547865825dc0048c18fc228 Mon Sep 17 00:00:00 2001 From: Anjana KJ <134688551+Anjana2310@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:35:11 +0530 Subject: [PATCH 08/26] Revert "workflow changes (#63)" (#65) This reverts commit 9fa025cc7a1ebae9ec2820eccf2024f0d7e562e0. From b486cbb32b3db17262e87e22c5550b63b45357cd Mon Sep 17 00:00:00 2001 From: Sweta Prakash <125380378+swetatech24@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:42:27 +0530 Subject: [PATCH 09/26] Delete .github/workflows/sast.yml (#66) Deleted sast.yml --- .github/workflows/sast.yml | 53 -------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 .github/workflows/sast.yml diff --git a/.github/workflows/sast.yml b/.github/workflows/sast.yml deleted file mode 100644 index c118ec3c..00000000 --- a/.github/workflows/sast.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: CodeQL - -on: - push: - branches: [ "develop" ] - paths-ignore: - - target/** - - dist/** - pull_request: - branches: [ "develop" ] - paths-ignore: - - target/** - - dist/** - -jobs: - analyze: - name: Analyze - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - - - name: Setup JDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: 'adopt' - - - name: Build with Maven - run: mvn clean install - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" From 23617b786d19830786493d62f8cdc92d1db739d6 Mon Sep 17 00:00:00 2001 From: Vidyadevi Salunkhe <84471226+Vidyaaa24@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:58:39 +0530 Subject: [PATCH 10/26] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b6694cd9..781e5a21 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,3 @@ This service has been tested on Wildfly as the application server. ## Usage All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details. - From 29d5b69b48d80dfe14d8c9de22dd97759eba2a55 Mon Sep 17 00:00:00 2001 From: Vidyadevi Salunkhe <84471226+Vidyaaa24@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:04:57 +0530 Subject: [PATCH 11/26] Create sast.yml --- .github/workflows/sast.yml | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/sast.yml diff --git a/.github/workflows/sast.yml b/.github/workflows/sast.yml new file mode 100644 index 00000000..5a5f1fad --- /dev/null +++ b/.github/workflows/sast.yml @@ -0,0 +1,51 @@ +name: "CodeQL" + +on: + push: + branches: [ "develop" ] + paths-ignore: + - target/** + + pull_request: + branches: [ "develop" ] + paths-ignore: + - target/** + +jobs: + analyze: + name: Analyze + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Setup JDK 8 + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean install + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From e78c9d94e00fae953c9cdd6dd8392061377399c7 Mon Sep 17 00:00:00 2001 From: Anjana Date: Fri, 15 Sep 2023 14:49:16 +0530 Subject: [PATCH 12/26] Modified common_local --- src/main/environment/common_dev.properties | 6 +-- src/main/environment/common_local.properties | 53 +++++++------------- src/main/environment/common_test.properties | 6 +-- src/main/environment/common_uat.properties | 6 +-- src/main/resources/application.properties | 3 -- 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/src/main/environment/common_dev.properties b/src/main/environment/common_dev.properties index 74304541..8d238407 100644 --- a/src/main/environment/common_dev.properties +++ b/src/main/environment/common_dev.properties @@ -1,8 +1,8 @@ # dev env # DB Connections -spring.datasource.url= -spring.datasource.username= -spring.datasource.password= +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= spring.datasource.driver-class-name=com.mysql.jdbc.Driver diff --git a/src/main/environment/common_local.properties b/src/main/environment/common_local.properties index 8da9435c..890c06a8 100644 --- a/src/main/environment/common_local.properties +++ b/src/main/environment/common_local.properties @@ -1,72 +1,55 @@ # local env # DB Connections -spring.datasource.url= -spring.datasource.username= -spring.datasource.password= +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= spring.datasource.driver-class-name=com.mysql.jdbc.Driver ## Carestream URLs -#carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder -carestreamOrderCreateURL =http://10.208.122.38:8080/commonapi-v1.0/carestream/createOrder +carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder ## Identity - Common URLs # Registration -#registrationUrl =http://localhost:8080/beneficiary/create -registrationUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/create +registrationUrl =http://localhost:8080/beneficiary/create -#syncSearchByLocation =http://localhost:8082/id/searchByDistrictId -syncSearchByLocation =http://10.208.122.38:8080/identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =http://localhost:8082/id/searchByDistrictId -#registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID -registrarQuickSearchByIdUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchUserByID +registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID -#registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone -registrarQuickSearchByPhoneNoUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchUserByPhone +registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone -#getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID -getBenImageFromIdentity =http://10.208.122.38:8080/identity-0.0.1/id/benImageByBenRegID +getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID ##save covid Vaccine details coming from mobile app through fhir -#saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails -saveCovidVaccineDetailsURL = http://10.208.122.38:8080/commonapi-v1.0/covid/saveCovidVaccinationDetails +saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails ##beneficiary edit -#beneficiaryEditUrl =http://localhost:8080/beneficiary/update -beneficiaryEditUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/update +beneficiaryEditUrl =http://localhost:8080/beneficiary/update ## Advance Search -#registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary -registrarAdvanceSearchUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchBeneficiary +registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary ## Data Sync API -#dataSyncUploadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/van-to-server -dataSyncUploadUrl= +dataSyncUploadUrl==http://localhost:8080/dataSync/van-to-server ## Data download API -#dataSyncDownloadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/server-to-van -dataSyncDownloadUrl= +dataSyncDownloadUrl==http://localhost:8080/dataSync/server-to-van ## TC specialist slot booking -#tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot -tcSpecialistSlotBook=http://10.208.122.38:8080/schedulerapi-v1.0/schedule/bookSlot +tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot ## TC specialist slot cancelling -#tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot -tcSpecialistSlotCancel=http://10.208.122.38:8080/schedulerapi-v1.0/schedule/cancelBookedSlot +tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot ## TM sms to beneficiary(schedule, cancel, reschedule) -#sendSMSUrl=http://localhost:8080/sms/sendSMS -sendSMSUrl=http://10.208.122.38:8080/commonapi-v1.0/sms/sendSMS +sendSMSUrl=http://localhost:8080/sms/sendSMS ### get openkm doc download url -#openkmDocUrl=http://localhost:8080/sms/sendSMS -openkmDocUrl=http://10.208.122.38:8080/commonapi-v1.0/kmfilemanager/getKMFileDownloadURL +openkmDocUrl=http://localhost:8080/kmfilemanager/getKMFileDownloadURL ##Fetosense Url foetalMonitor-api-url-ANCTestDetails=http://localhost:8080/foetalMonitor/registerMother - - ## TM SMS template details(SMS type) schedule=TC Schedule SMS cancel=TC Cancel SMS diff --git a/src/main/environment/common_test.properties b/src/main/environment/common_test.properties index b6ec4982..055fe28c 100644 --- a/src/main/environment/common_test.properties +++ b/src/main/environment/common_test.properties @@ -1,8 +1,8 @@ # Test env # DB Connections -spring.datasource.url= -spring.datasource.username= -spring.datasource.password= +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= spring.datasource.driver-class-name=com.mysql.jdbc.Driver diff --git a/src/main/environment/common_uat.properties b/src/main/environment/common_uat.properties index 562029d0..30d96980 100644 --- a/src/main/environment/common_uat.properties +++ b/src/main/environment/common_uat.properties @@ -1,9 +1,9 @@ # dev env # DB Connections -spring.datasource.url= -spring.datasource.username= -spring.datasource.password= +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= spring.datasource.driver-class-name=com.mysql.jdbc.Driver diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e9c5c763..ae7cae8f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -36,9 +36,6 @@ TMReferredWL=90 ## file storage path for fetosense report foetalMonitorFilePath=C:/FetosenseReport - - - logging.level.root=INFO logging.level.org.springframework.web=INFO logging.level.org.hibernate=INFO From 8fccf8c9e962e12beec718c73c86331244015209 Mon Sep 17 00:00:00 2001 From: Anjana Date: Fri, 22 Sep 2023 10:02:25 +0530 Subject: [PATCH 13/26] Pull Request template --- .github/PULL_REQUEST_TEMPLATE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..9098e605 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +# Description + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +# How Has This Been Tested? + +Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration. + +- [ ] Test A +- [ ] Test B + +# Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] Any dependent changes have been merged and published in downstream modules From b5975a23f3f73cfba9d2d7567da6ee38ed6b3c34 Mon Sep 17 00:00:00 2001 From: Anjana Date: Fri, 22 Sep 2023 11:00:37 +0530 Subject: [PATCH 14/26] Placeholders added in properties file --- README.md | 57 ++++++++++-- src/main/environment/common_dev.properties | 43 +++------ .../environment/common_example.properties | 74 +++++++++++++++ src/main/environment/common_prod.properties | 93 +++++++++++++++++++ src/main/environment/common_test.properties | 45 ++++----- src/main/environment/common_uat.properties | 67 ++++++------- src/main/resources/myApp.properties | 63 ------------- 7 files changed, 279 insertions(+), 163 deletions(-) create mode 100644 src/main/environment/common_example.properties create mode 100644 src/main/environment/common_prod.properties delete mode 100644 src/main/resources/myApp.properties diff --git a/README.md b/README.md index 781e5a21..e07863f6 100644 --- a/README.md +++ b/README.md @@ -26,22 +26,61 @@ Health and Wellness centre (HWC) is one of the comprehensive applications of AMR ## Building From Source This microservice is built on Java, Spring boot framework and MySQL DB. -### Prerequisites +### Pre-requisites * JDK 1.8 -* Maven +* Spring Tool Suite 3 / Eclipse(2023-03) +* Maven (if not pre-installed with the editor) +* Redis-x64-3.0.504 +* MySQL Workbench 8.0 -$ ./mvn clean install +### Creating a build configuration in STS / Eclipse -## Installation -This service has been tested on Wildfly as the application server. +* In your editor, click on Run -> Run configuration. +* Double click on Maven build and give a suitable name for the new configuration. +* Populate the base directory by clicking on workspace and selecting HWC-API module. +* Set goals to clean install -DENV_VAR=example(your choice of desired environment) and click on Apply. +* It is advisable have a personal environment properties file under src/main/environment filling out all the placeholders to avoid repetitive manual work each time you run locally. +* Click Run to run the build configuration. -### Prerequisites -* Wildfly (or any compatible app server) -* Redis -* MySQL Database +### Creating a run configuration in STS / Eclipse + +* In your editor, click on Run -> Run configuration. +* Double click on Spring Boot App(in STS) / Java Application(in Eclipse) and give a suitable name for the new configuration. +* Select the project and main class and click on Apply. +* Click Run to run the configuration. Keep the Redis server open during this run. +* Once the run is complete, load http://localhost:8080/swagger-ui.html#!/ + +### How to Import, Build, and Run Maven Code in Visual Studio Code + +1. **Install Visual Studio Code**: Download and install [Visual Studio Code](https://code.visualstudio.com/) from the official website. + +2. **Install Java**: Ensure you have the Java Development Kit (JDK 1.8) installed on your computer. You can download it from the [Oracle website](https://www.oracle.com/java/technologies/javase-downloads.html) or use an open-source JDK like [OpenJDK](https://adoptopenjdk.net/). + +3. **Install Maven**: Make sure you have Apache Maven installed on your system. Download it from the [Apache Maven website](https://maven.apache.org/download.cgi). + +4. **Install Visual Studio Code Extensions**: + - **Java Extension Pack**: Open Visual Studio Code, go to the Extensions view by clicking on the Extensions icon in the Activity Bar, and search for "Java Extension Pack." Install it to get Java support and Maven integration. + +5. **Open the Project in Visual Studio Code**: + - Launch Visual Studio Code. + - Use the **File > Open Folder** option to open your Maven project folder. + +6. **Configure Java and Maven**: + - If not already configured, set up your Java Home and Maven Home in Visual Studio Code. + - Go to **File > Preferences > Settings**, search for "Java Home" and "Maven Home," and specify the paths to your JDK and Maven installations. + +7. **Build and Run**: + - To build and run your Maven project, open the integrated terminal in Visual Studio Code (**Terminal > New Terminal**). + - Navigate to your project directory using the `cd` command. + - Use Maven commands like `mvn clean install` to build your project. + - To run your Java application, use mvn spring-boot:run. Ensure the redis server is open during run. + +##DB restoration +[blank_db_zip](https://psmri.github.io/PSMRI/developer-guides/technical-overview/#db-restoration) ## Integrations * Video Consultation ## Usage All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details. + diff --git a/src/main/environment/common_dev.properties b/src/main/environment/common_dev.properties index 8d238407..de056dd4 100644 --- a/src/main/environment/common_dev.properties +++ b/src/main/environment/common_dev.properties @@ -9,61 +9,46 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver ## Carestream URLs -#carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder -carestreamOrderCreateURL =http://10.208.122.32:8080/hwc-commonapi-v1.0/carestream/createOrder +carestreamOrderCreateURL =/hwc-commonapi-v1.0/carestream/createOrder ## Identity - Common URLs # Registration -#registrationUrl =http://localhost:8080/beneficiary/create -registrationUrl =http://10.208.122.32:8080/hwc-commonapi-v1.0/beneficiary/create +registrationUrl =/hwc-commonapi-v1.0/beneficiary/create -#syncSearchByLocation =http://localhost:8082/id/searchByDistrictId -syncSearchByLocation =http://10.208.122.32:8080/hwc-identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/hwc-identity-0.0.1/id/searchByDistrictId -#registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID -registrarQuickSearchByIdUrl =http://10.208.122.32:8080/hwc-commonapi-v1.0/beneficiary/searchUserByID +registrarQuickSearchByIdUrl =/hwc-commonapi-v1.0/beneficiary/searchUserByID -#registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone -registrarQuickSearchByPhoneNoUrl =http://10.208.122.32:8080/hwc-commonapi-v1.0/beneficiary/searchUserByPhone +registrarQuickSearchByPhoneNoUrl =/hwc-commonapi-v1.0/beneficiary/searchUserByPhone -#getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID -getBenImageFromIdentity =http://10.208.122.32:8080/hwc-identity-0.0.1/id/benImageByBenRegID +getBenImageFromIdentity =/hwc-identity-0.0.1/id/benImageByBenRegID ##save covid Vaccine details coming from mobile app through fhir -#saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails -saveCovidVaccineDetailsURL = http://10.208.122.32:8080/hwc-commonapi-v1.0/covid/saveCovidVaccinationDetails +saveCovidVaccineDetailsURL = /hwc-commonapi-v1.0/covid/saveCovidVaccinationDetails ##beneficiary edit -#beneficiaryEditUrl =http://localhost:8080/beneficiary/update -beneficiaryEditUrl =http://10.208.122.32:8080/hwc-commonapi-v1.0/beneficiary/update +beneficiaryEditUrl =/hwc-commonapi-v1.0/beneficiary/update ## Advance Search -#registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary -registrarAdvanceSearchUrl =http://10.208.122.32:8080/hwc-commonapi-v1.0/beneficiary/searchBeneficiary +registrarAdvanceSearchUrl =/hwc-commonapi-v1.0/beneficiary/searchBeneficiary ## Data Sync API -#dataSyncUploadUrl=http://10.208.122.32:8080/mmuapi-v1.0/dataSync/van-to-server dataSyncUploadUrl= ## Data download API -#dataSyncDownloadUrl=http://10.208.122.32:8080/mmuapi-v1.0/dataSync/server-to-van dataSyncDownloadUrl= ## TC specialist slot booking -#tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot -tcSpecialistSlotBook=http://10.208.122.32:8080/schedulerapi-v1.0/schedule/bookSlot -#getQuickbloxIds=http://localhost:8080/quickblox/getquickbloxIds +tcSpecialistSlotBook=/schedulerapi-v1.0/schedule/bookSlot + ## TC specialist slot cancelling -#tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot -tcSpecialistSlotCancel=http://10.208.122.32:8080/schedulerapi-v1.0/schedule/cancelBookedSlot +tcSpecialistSlotCancel=/schedulerapi-v1.0/schedule/cancelBookedSlot ## TM sms to beneficiary(schedule, cancel, reschedule) -#sendSMSUrl=http://localhost:8080/sms/sendSMS -sendSMSUrl=http://10.208.122.32:8080/hwc-commonapi-v1.0/sms/sendSMS +sendSMSUrl=/hwc-commonapi-v1.0/sms/sendSMS ### get openkm doc download url -#openkmDocUrl=http://localhost:8080/sms/sendSMS -openkmDocUrl=http://10.208.122.32:8080/hwc-commonapi-v1.0/kmfilemanager/getKMFileDownloadURL +openkmDocUrl=/hwc-commonapi-v1.0/kmfilemanager/getKMFileDownloadURL ##Fetosense Url foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother diff --git a/src/main/environment/common_example.properties b/src/main/environment/common_example.properties new file mode 100644 index 00000000..8388d1f7 --- /dev/null +++ b/src/main/environment/common_example.properties @@ -0,0 +1,74 @@ +# local env +# DB Connections +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= +spring.datasource.driver-class-name=com.mysql.jdbc.Driver + +## Carestream URLs +carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder + +## Identity - Common URLs +# Registration +registrationUrl =http://localhost:8080/beneficiary/create + +syncSearchByLocation =http://localhost:8082/id/searchByDistrictId + +registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID + +registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone + +getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID + +##save covid Vaccine details coming from mobile app through fhir +saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails + +##beneficiary edit +beneficiaryEditUrl =http://localhost:8080/beneficiary/update + +## Advance Search +registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary + +## Data Sync API +dataSyncUploadUrl==http://localhost:8080/dataSync/van-to-server + +## Data download API +dataSyncDownloadUrl==http://localhost:8080/dataSync/server-to-van + +## TC specialist slot booking +tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot + +## TC specialist slot cancelling +tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot + +## TM sms to beneficiary(schedule, cancel, reschedule) +sendSMSUrl=http://localhost:8080/sms/sendSMS + +### get openkm doc download url +openkmDocUrl=http://localhost:8080/kmfilemanager/getKMFileDownloadURL + +##Fetosense Url +foetalMonitor-api-url-ANCTestDetails=http://localhost:8080/foetalMonitor/registerMother +#foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother + +## TM SMS template details(SMS type) +schedule=TC Schedule SMS +cancel=TC Cancel SMS +reSchedule=TC Reschedule SMS + +snomedCTPageSize=10 + +nurseWL=7 +nurseTCWL=7 +docWL=7 +pharmaWL=7 +labWL=7 +radioWL=7 +oncoWL=7 +tcSpeclistWL=7 + +### Redis IP +spring.redis.host=localhost + + + diff --git a/src/main/environment/common_prod.properties b/src/main/environment/common_prod.properties new file mode 100644 index 00000000..aadcc528 --- /dev/null +++ b/src/main/environment/common_prod.properties @@ -0,0 +1,93 @@ +# Test env +# DB Connections +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= +spring.datasource.driver-class-name=com.mysql.jdbc.Driver + + + +## Carestream URLs +carestreamOrderCreateURL =/commonapi-v1.0/carestream/createOrder + +## Identity - Common URLs +# Registration +registrationUrl =/commonapi-v1.0/beneficiary/create + +syncSearchByLocation =/identity-0.0.1/id/searchByDistrictId + +registrarQuickSearchByIdUrl =/commonapi-v1.0/beneficiary/searchUserByID + +registrarQuickSearchByPhoneNoUrl =/commonapi-v1.0/beneficiary/searchUserByPhone + +getBenImageFromIdentity =/identity-0.0.1/id/benImageByBenRegID + +##save covid Vaccine details coming from mobile app through fhir +saveCovidVaccineDetailsURL = /commonapi-v1.0/covid/saveCovidVaccinationDetails + +##beneficiary edit +beneficiaryEditUrl =/commonapi-v1.0/beneficiary/update + +## Advance Search +registrarAdvanceSearchUrl =/commonapi-v1.0/beneficiary/searchBeneficiary + +## Data Sync API +#dataSyncUploadUrl=/mmuapi-v1.0/dataSync/van-to-server +dataSyncUploadUrl= + +## Data download API +#dataSyncDownloadUrl=/mmuapi-v1.0/dataSync/server-to-van +dataSyncDownloadUrl= + +## TC specialist slot booking +tcSpecialistSlotBook=/schedulerapi-v1.0/schedule/bookSlot + +## TC specialist slot cancelling +tcSpecialistSlotCancel=/schedulerapi-v1.0/schedule/cancelBookedSlot + +## TM sms to beneficiary(schedule, cancel, reschedule) +sendSMSUrl=/commonapi-v1.0/sms/sendSMS + +### get openkm doc download url +openkmDocUrl=/commonapi-v1.0/kmfilemanager/getKMFileDownloadURL + +##Fetosense Url +foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother + +## apiKey for calling fetosense api +foetalMonitorAPIKey = jCksvGZYhYssfqLXhsLf + +## TM SMS template details(SMS type) +schedule=TC Schedule SMS +cancel=TC Cancel SMS +reSchedule=TC Reschedule SMS + +snomedCTPageSize=10 + +nurseWL=7 +nurseTCWL=7 +docWL=7 +pharmaWL=7 +labWL=7 +radioWL=7 +oncoWL=7 +tcSpeclistWL=7 + + +servicePointID: 235 +parkingPlaceID: 233 +providerServiceMapID: 1261 +vanID: 220 +serviceID: 4 +providerID: 500 +appId: 85696 +authKey: 8BfRcBAGkTQkbQ6 +authSecret: jgQRyySBGu2YcaJ +scheduling-slotsize=5 +prescription=TMPrescription SMS + +### Redis IP +spring.redis.host=localhost + + + diff --git a/src/main/environment/common_test.properties b/src/main/environment/common_test.properties index 055fe28c..aadcc528 100644 --- a/src/main/environment/common_test.properties +++ b/src/main/environment/common_test.properties @@ -8,61 +8,48 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver ## Carestream URLs -#carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder -carestreamOrderCreateURL =http://10.208.122.38:8080/commonapi-v1.0/carestream/createOrder +carestreamOrderCreateURL =/commonapi-v1.0/carestream/createOrder ## Identity - Common URLs # Registration -#registrationUrl =http://localhost:8080/beneficiary/create -registrationUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/create +registrationUrl =/commonapi-v1.0/beneficiary/create -#syncSearchByLocation =http://localhost:8082/id/searchByDistrictId -syncSearchByLocation =http://10.208.122.38:8080/identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/identity-0.0.1/id/searchByDistrictId -#registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID -registrarQuickSearchByIdUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchUserByID +registrarQuickSearchByIdUrl =/commonapi-v1.0/beneficiary/searchUserByID -#registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone -registrarQuickSearchByPhoneNoUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchUserByPhone +registrarQuickSearchByPhoneNoUrl =/commonapi-v1.0/beneficiary/searchUserByPhone -#getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID -getBenImageFromIdentity =http://10.208.122.38:8080/identity-0.0.1/id/benImageByBenRegID +getBenImageFromIdentity =/identity-0.0.1/id/benImageByBenRegID ##save covid Vaccine details coming from mobile app through fhir -#saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails -saveCovidVaccineDetailsURL = http://10.208.122.38:8080/commonapi-v1.0/covid/saveCovidVaccinationDetails +saveCovidVaccineDetailsURL = /commonapi-v1.0/covid/saveCovidVaccinationDetails ##beneficiary edit -#beneficiaryEditUrl =http://localhost:8080/beneficiary/update -beneficiaryEditUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/update +beneficiaryEditUrl =/commonapi-v1.0/beneficiary/update ## Advance Search -#registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary -registrarAdvanceSearchUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchBeneficiary +registrarAdvanceSearchUrl =/commonapi-v1.0/beneficiary/searchBeneficiary ## Data Sync API -#dataSyncUploadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/van-to-server +#dataSyncUploadUrl=/mmuapi-v1.0/dataSync/van-to-server dataSyncUploadUrl= ## Data download API -#dataSyncDownloadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/server-to-van +#dataSyncDownloadUrl=/mmuapi-v1.0/dataSync/server-to-van dataSyncDownloadUrl= ## TC specialist slot booking -#tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot -tcSpecialistSlotBook=http://10.208.122.38:8080/schedulerapi-v1.0/schedule/bookSlot -#getQuickbloxIds=http://localhost:8080/quickblox/getquickbloxIds +tcSpecialistSlotBook=/schedulerapi-v1.0/schedule/bookSlot + ## TC specialist slot cancelling -#tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot -tcSpecialistSlotCancel=http://10.208.122.38:8080/schedulerapi-v1.0/schedule/cancelBookedSlot +tcSpecialistSlotCancel=/schedulerapi-v1.0/schedule/cancelBookedSlot ## TM sms to beneficiary(schedule, cancel, reschedule) -#sendSMSUrl=http://localhost:8080/sms/sendSMS -sendSMSUrl=http://10.208.122.38:8080/commonapi-v1.0/sms/sendSMS +sendSMSUrl=/commonapi-v1.0/sms/sendSMS ### get openkm doc download url -#openkmDocUrl=http://localhost:8080/sms/sendSMS -openkmDocUrl=http://10.208.122.38:8080/commonapi-v1.0/kmfilemanager/getKMFileDownloadURL +openkmDocUrl=/commonapi-v1.0/kmfilemanager/getKMFileDownloadURL ##Fetosense Url foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother diff --git a/src/main/environment/common_uat.properties b/src/main/environment/common_uat.properties index 30d96980..aadcc528 100644 --- a/src/main/environment/common_uat.properties +++ b/src/main/environment/common_uat.properties @@ -1,5 +1,4 @@ - -# dev env +# Test env # DB Connections spring.datasource.url= spring.datasource.username= @@ -9,66 +8,54 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver ## Carestream URLs -#carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder -carestreamOrderCreateURL =http://10.208.122.38:8080/commonapi-v1.0/carestream/createOrder +carestreamOrderCreateURL =/commonapi-v1.0/carestream/createOrder ## Identity - Common URLs # Registration -#registrationUrl =http://localhost:8080/beneficiary/create -registrationUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/create +registrationUrl =/commonapi-v1.0/beneficiary/create -#syncSearchByLocation =http://localhost:8082/id/searchByDistrictId -syncSearchByLocation =http://10.208.122.38:8080/identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/identity-0.0.1/id/searchByDistrictId -#registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID -registrarQuickSearchByIdUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchUserByID +registrarQuickSearchByIdUrl =/commonapi-v1.0/beneficiary/searchUserByID -#registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone -registrarQuickSearchByPhoneNoUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchUserByPhone +registrarQuickSearchByPhoneNoUrl =/commonapi-v1.0/beneficiary/searchUserByPhone -#getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID -getBenImageFromIdentity =http://10.208.122.38:8080/identity-0.0.1/id/benImageByBenRegID +getBenImageFromIdentity =/identity-0.0.1/id/benImageByBenRegID ##save covid Vaccine details coming from mobile app through fhir -#saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails -saveCovidVaccineDetailsURL = http://10.208.122.38:8080/commonapi-v1.0/covid/saveCovidVaccinationDetails +saveCovidVaccineDetailsURL = /commonapi-v1.0/covid/saveCovidVaccinationDetails ##beneficiary edit -#beneficiaryEditUrl =http://localhost:8080/beneficiary/update -beneficiaryEditUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/update +beneficiaryEditUrl =/commonapi-v1.0/beneficiary/update ## Advance Search -#registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary -registrarAdvanceSearchUrl =http://10.208.122.38:8080/commonapi-v1.0/beneficiary/searchBeneficiary +registrarAdvanceSearchUrl =/commonapi-v1.0/beneficiary/searchBeneficiary ## Data Sync API -#dataSyncUploadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/van-to-server +#dataSyncUploadUrl=/mmuapi-v1.0/dataSync/van-to-server dataSyncUploadUrl= ## Data download API -#dataSyncDownloadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/server-to-van +#dataSyncDownloadUrl=/mmuapi-v1.0/dataSync/server-to-van dataSyncDownloadUrl= ## TC specialist slot booking -#tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot -tcSpecialistSlotBook=http://10.208.122.38:8080/schedulerapi-v1.0/schedule/bookSlot +tcSpecialistSlotBook=/schedulerapi-v1.0/schedule/bookSlot ## TC specialist slot cancelling -#tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot -tcSpecialistSlotCancel=http://10.208.122.38:8080/schedulerapi-v1.0/schedule/cancelBookedSlot +tcSpecialistSlotCancel=/schedulerapi-v1.0/schedule/cancelBookedSlot ## TM sms to beneficiary(schedule, cancel, reschedule) -#sendSMSUrl=http://localhost:8080/sms/sendSMS -sendSMSUrl=http://10.208.122.38:8080/commonapi-v1.0/sms/sendSMS +sendSMSUrl=/commonapi-v1.0/sms/sendSMS ### get openkm doc download url -#openkmDocUrl=http://localhost:8080/sms/sendSMS -openkmDocUrl=http://10.208.122.38:8080/commonapi-v1.0/kmfilemanager/getKMFileDownloadURL - -##foetalMonitor Url -foetalMonitor-api-url-ANCTestDetails=http://localhost:8080/foetalMonitor/registerMother +openkmDocUrl=/commonapi-v1.0/kmfilemanager/getKMFileDownloadURL +##Fetosense Url +foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother +## apiKey for calling fetosense api +foetalMonitorAPIKey = jCksvGZYhYssfqLXhsLf ## TM SMS template details(SMS type) schedule=TC Schedule SMS @@ -86,7 +73,21 @@ radioWL=7 oncoWL=7 tcSpeclistWL=7 + +servicePointID: 235 +parkingPlaceID: 233 +providerServiceMapID: 1261 +vanID: 220 +serviceID: 4 +providerID: 500 +appId: 85696 +authKey: 8BfRcBAGkTQkbQ6 +authSecret: jgQRyySBGu2YcaJ +scheduling-slotsize=5 +prescription=TMPrescription SMS + ### Redis IP spring.redis.host=localhost + diff --git a/src/main/resources/myApp.properties b/src/main/resources/myApp.properties deleted file mode 100644 index 99036925..00000000 --- a/src/main/resources/myApp.properties +++ /dev/null @@ -1,63 +0,0 @@ -## Carestream URLs -#carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder -carestreamOrderCreateURL =http://10.208.122.32:8080/commonapi-v1.0/carestream/createOrder - -## Identity - Common URLs -# Registration -#registrationUrl =http://localhost:8080/beneficiary/create -registrationUrl =http://10.208.122.32:8080/commonapi-v1.0/beneficiary/create - -#registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID -registrarQuickSearchByIdUrl =http://10.208.122.32:8080/commonapi-v1.0/beneficiary/searchUserByID - -#registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone -registrarQuickSearchByPhoneNoUrl =http://10.208.122.32:8080/commonapi-v1.0/beneficiary/searchUserByPhone - -#getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID -getBenImageFromIdentity =http://10.208.122.32:8080/identity-0.0.1/id/benImageByBenRegID - -##beneficiary edit -#beneficiaryEditUrl =http://localhost:8080/beneficiary/update -beneficiaryEditUrl =http://10.208.122.32:8080/commonapi-v1.0/beneficiary/update - -## Advance Search -#registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary -registrarAdvanceSearchUrl =http://10.208.122.32:8080/commonapi-v1.0/beneficiary/searchBeneficiary - -## Data Sync API -#dataSyncUploadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/van-to-server -dataSyncUploadUrl= - -## Data download API -#dataSyncDownloadUrl=http://10.208.122.38:8080/mmuapi-v1.0/dataSync/server-to-van -dataSyncDownloadUrl= - -## TC specialist slot booking -#tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot -tcSpecialistSlotBook=http://10.208.122.32:8080/schedulerapi-v1.0/schedule/bookSlot - -## TC specialist slot cancelling -#tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot -tcSpecialistSlotCancel=http://10.208.122.32:8080/schedulerapi-v1.0/schedule/cancelBookedSlot - -## TM sms to beneficiary(schedule, cancel, reschedule) -#sendSMSUrl=http://localhost:8080/sms/sendSMS -sendSMSUrl=http://10.208.122.32:8080/commonapi-v1.0/sms/sendSMS - - - -## TM SMS template details(SMS type) -schedule=TC Schedule SMS -cancel=TC Cancel SMS -reSchedule=TC Reschedule SMS - -snomedCTPageSize=10 - -nurseWL=7 -nurseTCWL=7 -docWL=7 -pharmaWL=7 -labWL=7 -radioWL=7 -oncoWL=7 -tcSpeclistWL=7 \ No newline at end of file From 2e5af21f9fe1b4655db811593390576a1cc18881 Mon Sep 17 00:00:00 2001 From: Anjana KJ <134688551+Anjana2310@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:03:56 +0530 Subject: [PATCH 15/26] Delete src/main/environment/common_local.properties --- src/main/environment/common_local.properties | 73 -------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/main/environment/common_local.properties diff --git a/src/main/environment/common_local.properties b/src/main/environment/common_local.properties deleted file mode 100644 index 890c06a8..00000000 --- a/src/main/environment/common_local.properties +++ /dev/null @@ -1,73 +0,0 @@ -# local env -# DB Connections -spring.datasource.url= -spring.datasource.username= -spring.datasource.password= -spring.datasource.driver-class-name=com.mysql.jdbc.Driver - -## Carestream URLs -carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder - -## Identity - Common URLs -# Registration -registrationUrl =http://localhost:8080/beneficiary/create - -syncSearchByLocation =http://localhost:8082/id/searchByDistrictId - -registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID - -registrarQuickSearchByPhoneNoUrl =http://localhost:8080/beneficiary/searchUserByPhone - -getBenImageFromIdentity =http://localhost:8082/id/benImageByBenRegID - -##save covid Vaccine details coming from mobile app through fhir -saveCovidVaccineDetailsURL = http://localhost:8080/covid/saveCovidVaccinationDetails - -##beneficiary edit -beneficiaryEditUrl =http://localhost:8080/beneficiary/update - -## Advance Search -registrarAdvanceSearchUrl =http://localhost:8080/beneficiary/searchBeneficiary - -## Data Sync API -dataSyncUploadUrl==http://localhost:8080/dataSync/van-to-server - -## Data download API -dataSyncDownloadUrl==http://localhost:8080/dataSync/server-to-van - -## TC specialist slot booking -tcSpecialistSlotBook=http://localhost:9091/schedule/bookSlot - -## TC specialist slot cancelling -tcSpecialistSlotCancel=http://localhost:9091/schedule/cancelBookedSlot - -## TM sms to beneficiary(schedule, cancel, reschedule) -sendSMSUrl=http://localhost:8080/sms/sendSMS - -### get openkm doc download url -openkmDocUrl=http://localhost:8080/kmfilemanager/getKMFileDownloadURL - -##Fetosense Url -foetalMonitor-api-url-ANCTestDetails=http://localhost:8080/foetalMonitor/registerMother - -## TM SMS template details(SMS type) -schedule=TC Schedule SMS -cancel=TC Cancel SMS -reSchedule=TC Reschedule SMS - -snomedCTPageSize=10 - -nurseWL=7 -nurseTCWL=7 -docWL=7 -pharmaWL=7 -labWL=7 -radioWL=7 -oncoWL=7 -tcSpeclistWL=7 - -### Redis IP -spring.redis.host=localhost - - - From baa9e5f6f6e8b7ba055bd68c88314091e16d27c7 Mon Sep 17 00:00:00 2001 From: Anjana Date: Fri, 22 Sep 2023 15:23:42 +0530 Subject: [PATCH 16/26] Added type of change --- .github/PULL_REQUEST_TEMPLATE.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9098e605..58bdec2c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,8 +1,15 @@ # Description -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -Fixes # (issue) +# Type of change + +- [ ] Bug fix +- [ ] New feature +- [ ] Enhancement +- [ ] Refactoring +- [ ] Documentation +- [ ] Other ( please specify ) # How Has This Been Tested? @@ -19,3 +26,5 @@ Please describe the tests that you ran to verify your changes. Please also note - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] Any dependent changes have been merged and published in downstream modules + + From 3a6e21d56e17596ffdb9c9079e77533c67bcedc2 Mon Sep 17 00:00:00 2001 From: IN40068837 Date: Fri, 6 Oct 2023 11:23:57 +0530 Subject: [PATCH 17/26] New Serviceline API modified, UPTSU API changes --- .../data/nurse/BeneficiaryVisitDetail.java | 51 ++++ .../java/com/iemr/hwc/data/nurse/CDSS.java | 168 +++++++++++++ .../hwc/repo/nurse/BenVisitDetailRepo.java | 1 + .../com/iemr/hwc/repo/nurse/CDSSRepo.java | 16 ++ .../AdolescentAndChildCareServiceImpl.java | 89 ++++++- .../iemr/hwc/service/anc/ANCServiceImpl.java | 235 ++++++++++++------ .../transaction/CommonNurseService.java | 8 + .../transaction/CommonNurseServiceImpl.java | 220 ++++++++++++++-- .../service/covid19/Covid19ServiceImpl.java | 127 ++++++++-- .../FamilyPlanningServiceImpl.java | 105 +++++++- .../generalOPD/GeneralOPDServiceImpl.java | 162 +++++++++--- .../service/location/LocationServiceImpl.java | 56 +++-- .../service/ncdCare/NCDCareServiceImpl.java | 167 ++++++++++--- .../ncdscreening/NCDScreeningServiceImpl.java | 153 +++++++++--- .../service/neonatal/NeonatalServiceImpl.java | 89 ++++++- .../iemr/hwc/service/pnc/PNCServiceImpl.java | 173 ++++++++++--- .../QuickConsultationServiceImpl.java | 25 +- .../com/iemr/mmu/anc/TestANCServices.java | 1 + 18 files changed, 1554 insertions(+), 292 deletions(-) create mode 100644 src/main/java/com/iemr/hwc/data/nurse/CDSS.java create mode 100644 src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java diff --git a/src/main/java/com/iemr/hwc/data/nurse/BeneficiaryVisitDetail.java b/src/main/java/com/iemr/hwc/data/nurse/BeneficiaryVisitDetail.java index 407e379d..960c1003 100644 --- a/src/main/java/com/iemr/hwc/data/nurse/BeneficiaryVisitDetail.java +++ b/src/main/java/com/iemr/hwc/data/nurse/BeneficiaryVisitDetail.java @@ -37,6 +37,8 @@ import com.iemr.hwc.annotation.sqlInjectionSafe.SQLInjectionSafe; import com.iemr.hwc.data.provider.ProviderServiceMapping; +import lombok.Data; +@Data @Entity @Table(name = "t_benvisitdetail") public class BeneficiaryVisitDetail { @@ -195,6 +197,55 @@ public class BeneficiaryVisitDetail { @Transient private String[] sideEffects; + @Transient + private String selectedDiagnosisID; + + @Transient + private String selectedDiagnosis; + + @Transient + private String presentChiefComplaint; + + @Transient + private String presentChiefComplaintID; + + @Transient + private String recommendedAction; + + @Transient + private String remarks; + @Transient + private String algorithm; + + @Transient + private String recommendedActionPc; + + @Transient + private String remarksPc; + + @Transient + private String algorithmPc; + + @Transient + private Integer diseaseSummaryID; + + @Transient + private String diseaseSummary; + + @Transient + private String actionPc; + + @Transient + private Integer actionIdPc; + @Transient + private String action; + + @Transient + private Integer actionId; + + @Transient + private String informationGiven; + public BeneficiaryVisitDetail() { super(); diff --git a/src/main/java/com/iemr/hwc/data/nurse/CDSS.java b/src/main/java/com/iemr/hwc/data/nurse/CDSS.java new file mode 100644 index 00000000..2f1da732 --- /dev/null +++ b/src/main/java/com/iemr/hwc/data/nurse/CDSS.java @@ -0,0 +1,168 @@ +package com.iemr.hwc.data.nurse; + +import java.sql.Timestamp; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Embedded; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; + +import com.google.gson.annotations.Expose; +import com.iemr.hwc.annotation.sqlInjectionSafe.SQLInjectionSafe; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Table(name = "t_hwc_cdss") +@Entity +public class CDSS { + + @Id + @GeneratedValue + @Expose + @Column(name = "ID", insertable = false) + private Long id; + + @Expose + @Column(name = "BeneficiaryRegID") + private Long beneficiaryRegID; + + @Expose + @Column(name = "BenVisitID") + private Long benVisitID; + + @Expose + @Column(name = "ProviderServiceMapID") + private Integer providerServiceMapID; + + @Expose + @Column(name = "VisitCode") + private Long visitCode; + + @Expose + @Column(name = "SelecteDiagnosisID") + private String selectedDiagnosisID; + + @Expose + @Column(name = "SelecteDiagnosis") + private String selectedDiagnosis; + + @Expose + @Column(name = "PresentChiefComplaint") + private String presentChiefComplaint; + + @Expose + @Column(name = "PresentChiefComplaintID") + private String presentChiefComplaintID; + + @Expose + @Column(name = "RecommendedAction") + private String recommendedAction; + + @Expose + @Column(name = "Remarks") + private String remarks; + + @Expose + @Column(name = "Algorithm_cdss") + private String algorithm; + + @Expose + @Column(name = "RecommendedActionPc") + private String recommendedActionPc; + + @Expose + @Column(name = "RemarksPc") + private String remarksPc; + + @Expose + @Column(name = "AlgorithmPc") + private String algorithmPc; + + @Expose + @Column(name = "DiseasesummaryID") + private Integer diseaseSummaryID; + + @Expose + @Column(name = "DiseaseSummary") + private String diseaseSummary; + + @Expose + @Column(name = "ActionPc") + private String actionPc; + + @Expose + @Column(name = "ActionIdPc") + private Integer actionIdPc; + + @Expose + @Column(name = "Action") + private String action; + + @Expose + @Column(name = "ActionId") + private Integer actionId; + + @Expose + @Column(name = "informationGiven") + private String informationGiven; + + @Expose + @Column(name = "Deleted", insertable = false) + private Boolean deleted; + + @Expose + @Column(name = "CreatedBy") + private String createdBy; + + @Expose + @Column(name = "CreatedDate", insertable = false, updatable = false) + private Timestamp createdDate; + + @Expose + @Column(name = "ModifiedBy") + private String modifiedBy; + + @Expose + @Column(name = "LastModDate", insertable = false, updatable = false) + private Timestamp lastModDate; + + @Expose + @Column(name = "VanSerialNo") + private Long vanSerialNo; + + @Expose + @Column(name = "VehicalNo") + private @SQLInjectionSafe String vehicalNo; + + @Expose + @Column(name = "VanID") + private Integer vanID; + + @Expose + @Column(name = "ParkingPlaceID") + private Integer parkingPlaceID; + + @Expose + @Column(name = "SyncedBy") + private @SQLInjectionSafe String syncedBy; + + @Expose + @Column(name = "SyncedDate") + private Timestamp syncedDate; + + @Expose + @Column(name = "ReservedForChange") + private @SQLInjectionSafe String reservedForChange; + + + +} diff --git a/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java index 80fc2dba..2cb78bbd 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java @@ -119,4 +119,5 @@ public int updateFileID(@Param("fileIDs") String fileIDs, @Param("regID") Long r @Query(" SELECT bvd from BeneficiaryVisitDetail bvd WHERE bvd.benVisitID = :benVisitID AND bvd.lastModDate > :lastModDate ORDER BY bvd.lastModDate DESC") public BeneficiaryVisitDetail getVisitDetailsByVisitIDAndLastModifDate(@Param("benVisitID") Long benVisitID, @Param("lastModDate") Timestamp lastModDate); + } diff --git a/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java new file mode 100644 index 00000000..ba0597cb --- /dev/null +++ b/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java @@ -0,0 +1,16 @@ +package com.iemr.hwc.repo.nurse; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import com.iemr.hwc.data.nurse.CDSS; + +@Repository +public interface CDSSRepo extends CrudRepository { + + CDSS findByBeneficiaryRegIDAndVisitCode(Long beneficiaryRegID, Long visitCode); + + +} diff --git a/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java b/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java index b1bd3e30..1fccbc94 100644 --- a/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java @@ -49,6 +49,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; @@ -263,6 +264,79 @@ private Map saveBenVisitDetails(JsonObject visitDetailsOBJ, Common // Save Beneficiary Chief Complaints commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); } + + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis(presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); + } + } visitIdAndCodeMap.put("visitID", benVisitID); visitIdAndCodeMap.put("visitCode", benVisitCode); @@ -516,6 +590,8 @@ public String getBenVisitDetailsFrmNurseCAC(Long benRegID, Long visitCode) throw resMap.put("BenChiefComplaints", commonNurseServiceImpl.getBenChiefComplaints(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -532,7 +608,8 @@ public String getBirthAndImmuniHistory(Long benRegID, Long visitCode) throws IEM throw new IEMRException("no previous information found. please capture latest information"); } - HistoryDetailsMap.put("immunizationHistory", commonNurseServiceImpl.getImmunizationHistory(benRegID, visitCode)); + HistoryDetailsMap.put("immunizationHistory", + commonNurseServiceImpl.getImmunizationHistory(benRegID, visitCode)); InfantBirthDetails ibObj = infantBirthDetailsRepo.findByBeneficiaryRegIDAndVisitCode(benRegID, visitCode); @@ -553,6 +630,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + @Override public String getBeneficiaryImmunizationServiceDetails(Long beneficiaryRegID, Long visitCode) throws Exception { Map resMap = new HashMap<>(); @@ -644,6 +730,7 @@ public String getNurseDataCAC(Long benRegID, Long visitCode) throws Exception { resMap.put("history", getBirthAndImmuniHistory(benRegID, visitCode)); resMap.put("vitals", getBeneficiaryVitalDetails(benRegID, visitCode)); resMap.put("immunizationServices", getBeneficiaryImmunizationServiceDetails(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); return resMap.toString(); } diff --git a/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java b/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java index 3a0d788a..903efbe4 100644 --- a/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java @@ -72,6 +72,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; @@ -182,7 +183,7 @@ public String saveANCNurseData(JsonObject requestOBJ, String Authorization) thro nurseUtilityClass.setVisitCode(benVisitCode); nurseUtilityClass.setBenVisitID(benVisitID); - }else { + } else { Map responseMap = new HashMap(); responseMap.put("response", "Data already saved"); return new Gson().toJson(responseMap); @@ -365,7 +366,7 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw } else { findingSuccessFlag = 1; } - + // creating prescription object WrapperBenInvestigationANC wrapperBenInvestigationANC = InputMapper.gson() .fromJson(requestOBJ.get("investigation"), WrapperBenInvestigationANC.class); @@ -376,7 +377,7 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw && !requestOBJ.get("diagnosis").getAsJsonObject().get("specialistDiagnosis").isJsonNull()) { instruction = requestOBJ.get("diagnosis").getAsJsonObject().get("specialistDiagnosis").getAsString(); } - + String prescription_counsellingProvided = null; if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { @@ -390,7 +391,7 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw if (sb.length() >= 2) tempPrescription.setCounsellingProvided(sb.substring(0, sb.length() - 2)); prescription_counsellingProvided = tempPrescription.getCounsellingProvided(); - + } } @@ -398,7 +399,8 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw wrapperBenInvestigationANC.getBeneficiaryRegID(), wrapperBenInvestigationANC.getBenVisitID(), wrapperBenInvestigationANC.getProviderServiceMapID(), wrapperBenInvestigationANC.getCreatedBy(), wrapperBenInvestigationANC.getExternalInvestigations(), wrapperBenInvestigationANC.getVisitCode(), - wrapperBenInvestigationANC.getVanID(), wrapperBenInvestigationANC.getParkingPlaceID(), instruction, prescription_counsellingProvided, null); + wrapperBenInvestigationANC.getVanID(), wrapperBenInvestigationANC.getParkingPlaceID(), instruction, + prescription_counsellingProvided, null); // save prescribed lab test if (isTestPrescribed) { @@ -513,70 +515,148 @@ public Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonU // benVisitDetailsOBJ.setVanID(commonUtilityClass.getVanID()); // benVisitDetailsOBJ.setParkingPlaceID(commonUtilityClass.getParkingPlaceID()); - int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); - if(i<1) { - benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); - - // 07-06-2018 visit code - Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), - nurseUtilityClass.getSessionID()); - - if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { - if (visitDetailsOBJ.has("chiefComplaints") && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { - // Save Ben Chief Complaints - BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() - .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); - - List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); - if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { - for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { - benChiefComplaint.setBenVisitID(benVisitID); - benChiefComplaint.setVisitCode(benVisitCode); + int i = commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(), + benVisitDetailsOBJ.getVisitReason(), benVisitDetailsOBJ.getVisitCategory()); + if (i < 1) { + benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + + // 07-06-2018 visit code + Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), + nurseUtilityClass.getSessionID()); + + if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { + if (visitDetailsOBJ.has("chiefComplaints") + && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { + // Save Ben Chief Complaints + BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() + .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); + + List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); + if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { + for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { + benChiefComplaint.setBenVisitID(benVisitID); + benChiefComplaint.setVisitCode(benVisitCode); + } } + chiefComplaintsSuccessFlag = commonNurseServiceImpl + .saveBenChiefComplaints(benChiefComplaintList); } - chiefComplaintsSuccessFlag = commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); - } - if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { - // Save Ben Adherence - BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), - BenAdherence.class); - benAdherence.setBenVisitID(benVisitID); - benAdherence.setVisitCode(benVisitCode); - adherenceSuccessFlag = commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); - } - if (visitDetailsOBJ.has("investigation") && !visitDetailsOBJ.get("investigation").isJsonNull() - && visitDetailsOBJ.getAsJsonObject("investigation").get("laboratoryList") != null - && !visitDetailsOBJ.getAsJsonObject("investigation").get("laboratoryList").isJsonNull() - && visitDetailsOBJ.getAsJsonObject("investigation").getAsJsonArray("laboratoryList") - .size() > 0) { - // Save Ben Investigations - WrapperBenInvestigationANC wrapperBenInvestigationANC = InputMapper.gson() - .fromJson(visitDetailsOBJ.get("investigation"), WrapperBenInvestigationANC.class); - - if (wrapperBenInvestigationANC != null) { - wrapperBenInvestigationANC.setBenVisitID(benVisitID); - wrapperBenInvestigationANC.setVisitCode(benVisitCode); - investigationSuccessFlag = commonNurseServiceImpl - .saveBenInvestigationDetails(wrapperBenInvestigationANC); + if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { + // Save Ben Adherence + BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), + BenAdherence.class); + benAdherence.setBenVisitID(benVisitID); + benAdherence.setVisitCode(benVisitCode); + adherenceSuccessFlag = commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); + } + if (visitDetailsOBJ.has("investigation") && !visitDetailsOBJ.get("investigation").isJsonNull() + && visitDetailsOBJ.getAsJsonObject("investigation").get("laboratoryList") != null + && !visitDetailsOBJ.getAsJsonObject("investigation").get("laboratoryList").isJsonNull() + && visitDetailsOBJ.getAsJsonObject("investigation").getAsJsonArray("laboratoryList") + .size() > 0) { + // Save Ben Investigations + WrapperBenInvestigationANC wrapperBenInvestigationANC = InputMapper.gson() + .fromJson(visitDetailsOBJ.get("investigation"), WrapperBenInvestigationANC.class); + + if (wrapperBenInvestigationANC != null) { + wrapperBenInvestigationANC.setBenVisitID(benVisitID); + wrapperBenInvestigationANC.setVisitCode(benVisitCode); + investigationSuccessFlag = commonNurseServiceImpl + .saveBenInvestigationDetails(wrapperBenInvestigationANC); + + } else { + // Invalid Data.. + } } else { - // Invalid Data.. + investigationSuccessFlag = 1; + } + if (adherenceSuccessFlag > 0 && chiefComplaintsSuccessFlag > 0 && investigationSuccessFlag > 0) { + // Adherence, ChiefComplaints and Investigation Details + // stored successfully. + } + + // TODO Save Ben Upload Files + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis( + presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null + && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null + && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); } - } else { - investigationSuccessFlag = 1; - } - if (adherenceSuccessFlag > 0 && chiefComplaintsSuccessFlag > 0 && investigationSuccessFlag > 0) { - // Adherence, ChiefComplaints and Investigation Details - // stored successfully. } - // TODO Save Ben Upload Files + visitIdAndCodeMap.put("visitID", benVisitID); + visitIdAndCodeMap.put("visitCode", benVisitCode); } - - visitIdAndCodeMap.put("visitID", benVisitID); - visitIdAndCodeMap.put("visitCode", benVisitCode); - } } return visitIdAndCodeMap; } @@ -1045,6 +1125,8 @@ public String getBenVisitDetailsFrmNurseANC(Long benRegID, Long visitCode) { resMap.put("Investigation", commonNurseServiceImpl.getLabTestOrders(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -1100,6 +1182,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + @Override public String getANCExaminationDetailsData(Long benRegID, Long visitCode) { Map examinationDetailsMap = new HashMap(); @@ -1527,6 +1618,8 @@ public String getBenANCNurseData(Long benRegID, Long visitCode) throws IEMRExcep resMap.put("examination", getANCExaminationDetailsData(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); + return resMap.toString(); } @@ -1631,20 +1724,20 @@ public Long updateANCDoctorData(JsonObject requestOBJ, String Authorization) thr prescriptionDetail.setInstruction(ancDiagnosis.getSpecialistDiagnosis()); prescriptionDetail.setExternalInvestigation(wrapperBenInvestigationANC.getExternalInvestigations()); } - + if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { - + PrescriptionDetail tempPrescription = InputMapper.gson().fromJson(requestOBJ, PrescriptionDetail.class); - - if (tempPrescription != null && tempPrescription.getCounsellingProvidedList() != null - && tempPrescription.getCounsellingProvidedList().length > 0) { - StringBuffer sb = new StringBuffer(); - for (String s : tempPrescription.getCounsellingProvidedList()) { - sb.append(s).append("||"); - } - if (sb.length() >= 2) - prescriptionDetail.setCounsellingProvided(sb.substring(0, sb.length() - 2)); + + if (tempPrescription != null && tempPrescription.getCounsellingProvidedList() != null + && tempPrescription.getCounsellingProvidedList().length > 0) { + StringBuffer sb = new StringBuffer(); + for (String s : tempPrescription.getCounsellingProvidedList()) { + sb.append(s).append("||"); + } + if (sb.length() >= 2) + prescriptionDetail.setCounsellingProvided(sb.substring(0, sb.length() - 2)); } else prescriptionDetail.setCounsellingProvided(""); diff --git a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseService.java b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseService.java index 58f6becb..6052ee41 100644 --- a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseService.java +++ b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseService.java @@ -25,6 +25,7 @@ import com.iemr.hwc.utils.exception.IEMRException; public interface CommonNurseService { + public Long saveBeneficiaryVisitDetails(BeneficiaryVisitDetail beneficiaryVisitDetail, Integer sessionId); public Long saveBeneficiaryVisitDetails(BeneficiaryVisitDetail beneficiaryVisitDetail); public String getBenSymptomaticData(Long benRegID) throws Exception; @@ -34,4 +35,11 @@ public interface CommonNurseService { public String getBenPreviousReferralData(Long benRegID) throws Exception; public String calculateBMIStatus(String request) throws IEMRException; + + /** + * Save beneficiary visit details data and return beneficiary visit ID. + * + * @param beneficiaryVisitDetail + * @return + */ } diff --git a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java index 2b19fe70..a8ec6ca2 100644 --- a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java @@ -43,6 +43,7 @@ import org.springframework.stereotype.Service; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.iemr.hwc.data.anc.BenAdherence; import com.iemr.hwc.data.anc.BenAllergyHistory; @@ -83,6 +84,8 @@ import com.iemr.hwc.data.nurse.BenCancerVitalDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; +import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.LabTestOrderDetail; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; @@ -96,6 +99,7 @@ import com.iemr.hwc.repo.nurse.BenCancerVitalDetailRepo; import com.iemr.hwc.repo.nurse.BenPhysicalVitalRepo; import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; import com.iemr.hwc.repo.nurse.anc.BenAllergyHistoryRepo; import com.iemr.hwc.repo.nurse.anc.BenChildDevelopmentHistoryRepo; @@ -191,6 +195,8 @@ public class CommonNurseServiceImpl implements CommonNurseService { private CommonDoctorServiceImpl commonDoctorServiceImpl; @Autowired private BenReferDetailsRepo benReferDetailsRepo; + @Autowired + private CDSSRepo cdssRepo; @Autowired public void setCommonDoctorServiceImpl(CommonDoctorServiceImpl commonDoctorServiceImpl) { @@ -443,6 +449,7 @@ public Long saveBeneficiaryVisitDetails(BeneficiaryVisitDetail beneficiaryVisitD response = benVisitDetailRepo.save(beneficiaryVisitDetail); if (response != null) { + // Long visitCode = updateVisitCode(response, 10); return response.getBenVisitID(); } else @@ -450,27 +457,137 @@ public Long saveBeneficiaryVisitDetails(BeneficiaryVisitDetail beneficiaryVisitD } - public int getMaxCurrentdate(Long beneficiaryRegID,String visitreason,String visitcategory) throws IEMRException{ - String maxDate=benVisitDetailRepo.getMaxCreatedDate(beneficiaryRegID,visitreason,visitcategory); - - int i=0; - if(maxDate!=null) { - try { - DateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String maxdateTrim=maxDate.substring(0, maxDate.indexOf(".")); - java.util.Date d = timeFormat.parse(maxdateTrim); - Calendar cal = Calendar.getInstance(); - Calendar cal1 = Calendar.getInstance(); - cal.setTime(d); - cal.add(Calendar.MINUTE, 10); - i= cal.compareTo(cal1); - - } catch (ParseException e) { - throw new IEMRException("Error while parseing created date :" + e.getMessage()); + @Override + public Long saveBeneficiaryVisitDetails(BeneficiaryVisitDetail beneficiaryVisitDetail, Integer sessionId) { + BeneficiaryVisitDetail response = null; + + // get the total no of visit for the beneficiary (visit count) + Short benVisitCount = benVisitDetailRepo + .getVisitCountForBeneficiary(beneficiaryVisitDetail.getBeneficiaryRegID()); + + if (benVisitCount != null && benVisitCount >= 0) { + benVisitCount = (short) (benVisitCount + 1); + } else { + benVisitCount = 1; + } + beneficiaryVisitDetail.setVisitNo(benVisitCount); + + // file id, comma seperated + Integer[] docIdArr = beneficiaryVisitDetail.getFileIDs(); + StringBuilder sb = new StringBuilder(); + if (docIdArr != null && docIdArr.length > 0) { + for (Integer i : docIdArr) { + sb.append(i + ","); + } + } + beneficiaryVisitDetail.setReportFilePath(sb.toString()); + + if (beneficiaryVisitDetail.getFollowUpForFpMethod() != null + && beneficiaryVisitDetail.getFollowUpForFpMethod().length > 0) { + StringBuffer sb1 = new StringBuffer(); + for (String s : beneficiaryVisitDetail.getFollowUpForFpMethod()) { + sb1.append(s).append("||"); + } + if (sb1.length() >= 2) + beneficiaryVisitDetail.setFpMethodFollowup(sb1.substring(0, sb1.length() - 2)); + + } + + if (beneficiaryVisitDetail.getSideEffects() != null && beneficiaryVisitDetail.getSideEffects().length > 0) { + StringBuffer sb1 = new StringBuffer(); + for (String s : beneficiaryVisitDetail.getSideEffects()) { + sb1.append(s).append("||"); + } + if (sb1.length() >= 2) + beneficiaryVisitDetail.setFpSideeffects(sb1.substring(0, sb1.length() - 2)); + } + + response = benVisitDetailRepo.save(beneficiaryVisitDetail); + + if (response != null) { + Long benVisitId = response.getBenVisitID(); + Integer vanId = response.getVanID(); + Integer sessionIdObj = sessionId; + Long visitCode = generateVisitCode(benVisitId, vanId, sessionIdObj); + CDSS cdss = new CDSS(); + cdss.setVisitCode(visitCode); + cdss.setBenVisitID(benVisitId); + if (beneficiaryVisitDetail.getBeneficiaryRegID() != null) + cdss.setBeneficiaryRegID(beneficiaryVisitDetail.getBeneficiaryRegID()); + if (beneficiaryVisitDetail.getProviderServiceMapID() != null) + cdss.setProviderServiceMapID(beneficiaryVisitDetail.getProviderServiceMapID()); + if (beneficiaryVisitDetail.getCreatedBy() != null) + cdss.setCreatedBy(beneficiaryVisitDetail.getCreatedBy()); + if (beneficiaryVisitDetail.getVanID() != null) + cdss.setVanID(beneficiaryVisitDetail.getVanID()); + if (beneficiaryVisitDetail.getParkingPlaceID() != null) + cdss.setParkingPlaceID(beneficiaryVisitDetail.getParkingPlaceID()); + if (beneficiaryVisitDetail.getPresentChiefComplaint() != null) + cdss.setPresentChiefComplaint(beneficiaryVisitDetail.getPresentChiefComplaint()); + if (beneficiaryVisitDetail.getPresentChiefComplaintID() != null) + cdss.setPresentChiefComplaintID(beneficiaryVisitDetail.getPresentChiefComplaintID()); + if (beneficiaryVisitDetail.getSelectedDiagnosis() != null) + cdss.setSelectedDiagnosis(beneficiaryVisitDetail.getSelectedDiagnosis()); + if (beneficiaryVisitDetail.getSelectedDiagnosisID() != null) + cdss.setSelectedDiagnosisID(beneficiaryVisitDetail.getSelectedDiagnosisID()); + if (beneficiaryVisitDetail.getRecommendedAction() != null) + cdss.setRecommendedAction(beneficiaryVisitDetail.getRecommendedAction()); + if (beneficiaryVisitDetail.getRecommendedActionPc() != null) + cdss.setRecommendedActionPc(beneficiaryVisitDetail.getRecommendedActionPc()); + if (beneficiaryVisitDetail.getRemarks() != null) + cdss.setRemarks(beneficiaryVisitDetail.getRemarks()); + if (beneficiaryVisitDetail.getRemarksPc() != null) + cdss.setRemarksPc(beneficiaryVisitDetail.getRemarksPc()); + if (beneficiaryVisitDetail.getAlgorithm() != null) + cdss.setAlgorithm(beneficiaryVisitDetail.getAlgorithm()); + if (beneficiaryVisitDetail.getAlgorithmPc() != null) + cdss.setAlgorithmPc(beneficiaryVisitDetail.getAlgorithmPc()); + if (beneficiaryVisitDetail.getDiseaseSummary() != null) + cdss.setDiseaseSummary(beneficiaryVisitDetail.getDiseaseSummary()); + if (beneficiaryVisitDetail.getDiseaseSummaryID() != null) + cdss.setDiseaseSummaryID(beneficiaryVisitDetail.getDiseaseSummaryID()); + if (beneficiaryVisitDetail.getAction() != null) + cdss.setAction(beneficiaryVisitDetail.getAction()); + if (beneficiaryVisitDetail.getActionPc() != null) + cdss.setActionPc(beneficiaryVisitDetail.getActionPc()); + if (beneficiaryVisitDetail.getActionId() != null) + cdss.setActionId(beneficiaryVisitDetail.getActionId()); + if (beneficiaryVisitDetail.getActionIdPc() != null) + cdss.setActionIdPc(beneficiaryVisitDetail.getActionIdPc()); + if (beneficiaryVisitDetail.getInformationGiven() != null) + cdss.setInformationGiven(beneficiaryVisitDetail.getInformationGiven()); + + cdssRepo.save(cdss); + // Long visitCode = updateVisitCode(response, 10); + return response.getBenVisitID(); + } else + return null; + + } + + public int getMaxCurrentdate(Long beneficiaryRegID, String visitreason, String visitcategory) throws IEMRException { + String maxDate = benVisitDetailRepo.getMaxCreatedDate(beneficiaryRegID, visitreason, visitcategory); + + int i = 0; + if (maxDate != null) { + try { + DateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String maxdateTrim = maxDate.substring(0, maxDate.indexOf(".")); + java.util.Date d = timeFormat.parse(maxdateTrim); + Calendar cal = Calendar.getInstance(); + Calendar cal1 = Calendar.getInstance(); + cal.setTime(d); + cal.add(Calendar.MINUTE, 10); + i = cal.compareTo(cal1); + + } catch (ParseException e) { + throw new IEMRException("Error while parseing created date :" + e.getMessage()); + } } return i; } + public Long generateVisitCode(Long visitID, Integer vanID, Integer sessionID) { String visitCode = ""; @@ -582,6 +699,12 @@ public BeneficiaryVisitDetail getCSVisitDetails(Long benRegID, Long visitCode) { return benVisitDetailsOBJ; } + public CDSS getCdssDetails(Long benRegID, Long visitCode) { + CDSS cdssObj = new CDSS(); + cdssObj = cdssRepo.findByBeneficiaryRegIDAndVisitCode(benRegID, visitCode); + return cdssObj; + } + public int saveBenChiefComplaints(List benChiefComplaintList) { int r = 0; List benChiefComplaintListNew = new ArrayList<>(); @@ -1013,6 +1136,11 @@ public String getBeneficiaryPhysicalAnthropometryDetails(Long beneficiaryRegID, return new Gson().toJson(benAnthropometryDetail); } + public String getBenCdssDetails(Long beneficiaryRegID, Long visitCode) { + CDSS cdss = cdssRepo.findByBeneficiaryRegIDAndVisitCode(beneficiaryRegID, visitCode); + return new Gson().toJson(cdss); + } + public String getBeneficiaryPhysicalVitalDetails(Long beneficiaryRegID, Long visitCode) { BenPhysicalVitalDetail benPhysicalVitalDetail = benPhysicalVitalRepo.getBenPhysicalVitalDetail(beneficiaryRegID, visitCode); @@ -1934,6 +2062,44 @@ public String getBenChiefComplaints(Long beneficiaryRegID, Long visitCode) { return new Gson().toJson(benChiefComplaints); } + public String getBenCdss(Long beneficiaryRegID, Long visitCode) { + Map cdssData = new HashMap<>(); + CDSS cdss = cdssRepo.findByBeneficiaryRegIDAndVisitCode(beneficiaryRegID, visitCode); + + if (cdss != null) { + Map presentChiefComplaint = new HashMap<>(); + Map diseaseSummary = new HashMap<>(); + + presentChiefComplaint.put("selectedDiagnosisID", cdss.getSelectedDiagnosisID()); + presentChiefComplaint.put("selectedDiagnosis", cdss.getSelectedDiagnosis()); + presentChiefComplaint.put("presentChiefComplaint", cdss.getPresentChiefComplaint()); + presentChiefComplaint.put("presentChiefComplaintID", cdss.getPresentChiefComplaintID()); + presentChiefComplaint.put("algorithmPc", cdss.getAlgorithmPc()); + presentChiefComplaint.put("recommendedActionPc", cdss.getRecommendedActionPc()); + presentChiefComplaint.put("remarksPc", cdss.getRemarksPc()); + presentChiefComplaint.put("actionPc", cdss.getActionPc()); + presentChiefComplaint.put("actionIdPc", cdss.getActionIdPc()); + diseaseSummary.put("diseaseSummaryID", cdss.getDiseaseSummaryID()); + diseaseSummary.put("diseaseSummary", cdss.getDiseaseSummary()); + diseaseSummary.put("algorithm", cdss.getAlgorithm()); + diseaseSummary.put("recommendedAction", cdss.getRecommendedAction()); + diseaseSummary.put("remarks", cdss.getRemarks()); + diseaseSummary.put("action", cdss.getAction()); + diseaseSummary.put("actionId", cdss.getActionId()); + diseaseSummary.put("informationGiven", cdss.getInformationGiven()); + + cdssData.put("presentChiefComplaint", presentChiefComplaint); + cdssData.put("diseaseSummary", diseaseSummary); + cdssData.put("vanID", cdss.getVanID()); + cdssData.put("parkingPlaceID", cdss.getParkingPlaceID()); + cdssData.put("providerServiceMapID", cdss.getProviderServiceMapID()); + cdssData.put("beneficiaryRegID", cdss.getBeneficiaryRegID()); + cdssData.put("benVisitID", cdss.getBenVisitID()); + cdssData.put("createdBy", cdss.getCreatedBy()); + } + return new Gson().toJson(cdssData); + } + public BenFamilyHistory getFamilyHistoryDetail(Long beneficiaryRegID, Long visitCode) { // BenFamilyHistory familyHistory = benFamilyHistoryRepo.getBenFamilyHistoryDetails(beneficiaryRegID, visitCode); // @@ -2861,7 +3027,8 @@ public int updateOralExamination(OralExamination oralExamination) throws IEMRExc public Long savePrescriptionDetailsAndGetPrescriptionID(Long benRegID, Long benVisitID, Integer psmID, String createdBy, String externalInvestigation, Long benVisitCode, Integer vanID, Integer parkingPlaceID, - String instruction, String prescription_counsellingProvided, ArrayList provisionalDiagnosisList) { + String instruction, String prescription_counsellingProvided, + ArrayList provisionalDiagnosisList) { PrescriptionDetail prescriptionDetail = new PrescriptionDetail(); prescriptionDetail.setBeneficiaryRegID(benRegID); prescriptionDetail.setBenVisitID(benVisitID); @@ -2877,7 +3044,7 @@ public Long savePrescriptionDetailsAndGetPrescriptionID(Long benRegID, Long benV if (prescription_counsellingProvided != null) prescriptionDetail.setCounsellingProvided(prescription_counsellingProvided); - if(provisionalDiagnosisList != null) + if (provisionalDiagnosisList != null) prescriptionDetail.setProvisionalDiagnosisList(provisionalDiagnosisList); Long prescriptionID = saveBenPrescription(prescriptionDetail); @@ -2903,7 +3070,7 @@ public Long savePrescriptionCovid(Long benRegID, Long benVisitID, Integer psmID, if (doctorDiagnosis != null) prescriptionDetail.setDiagnosisProvided(doctorDiagnosis); - + prescriptionDetail.setCounsellingProvided(counsellingProvided); Long prescriptionID = saveBenPrescription(prescriptionDetail); @@ -3291,7 +3458,8 @@ public int saveBenInvestigationDetails(WrapperBenInvestigationANC wrapperBenInve wrapperBenInvestigationANC.getBeneficiaryRegID(), wrapperBenInvestigationANC.getBenVisitID(), wrapperBenInvestigationANC.getProviderServiceMapID(), wrapperBenInvestigationANC.getCreatedBy(), wrapperBenInvestigationANC.getExternalInvestigations(), wrapperBenInvestigationANC.getVisitCode(), - wrapperBenInvestigationANC.getVanID(), wrapperBenInvestigationANC.getParkingPlaceID(), null, null, null); + wrapperBenInvestigationANC.getVanID(), wrapperBenInvestigationANC.getParkingPlaceID(), null, null, + null); wrapperBenInvestigationANC.setPrescriptionID(prescriptionID); investigationSuccessFlag = saveBenInvestigation(wrapperBenInvestigationANC); @@ -3470,6 +3638,16 @@ public int saveBenAdherenceDetails(BenAdherence benAdherence) throws IEMRExcepti return r; } + public Long saveCdssDetails(CDSS cdss) throws IEMRException { + cdss = cdssRepo.save(cdss); + + if (cdss != null && cdss.getId() > 0) + return cdss.getId(); + else + throw new IEMRException("DB-Error in saving cdss details"); + + } + public Long saveChildDevelopmentHistory(BenChildDevelopmentHistory benChildDevelopmentHistory) throws IEMRException { Long developmentSuccessFlag = null; diff --git a/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java b/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java index 64193a74..79af7bdf 100644 --- a/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java @@ -55,6 +55,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; @@ -117,7 +118,7 @@ public String saveCovid19NurseData(JsonObject requestOBJ, String Authorization) nurseUtilityClass.setVisitCode(benVisitCode); nurseUtilityClass.setBenVisitID(benVisitID); - }else { + } else { Map responseMap = new HashMap(); responseMap.put("response", "Data already saved"); return new Gson().toJson(responseMap); @@ -217,17 +218,94 @@ public Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonU BeneficiaryVisitDetail benVisitDetailsOBJ = InputMapper.gson().fromJson(visitDetailsOBJ.get("visitDetails"), BeneficiaryVisitDetail.class); - int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); - if(i<1) { - benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); - - // 11-06-2018 visit code - Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), - nurseUtilityClass.getSessionID()); + int i = commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(), + benVisitDetailsOBJ.getVisitReason(), benVisitDetailsOBJ.getVisitCategory()); + if (i < 1) { + benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + + // 11-06-2018 visit code + Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), + nurseUtilityClass.getSessionID()); + if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis( + presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null + && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null + && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); + } - visitIdAndCodeMap.put("visitID", benVisitID); - visitIdAndCodeMap.put("visitCode", benVisitCode); - } + } + visitIdAndCodeMap.put("visitID", benVisitID); + visitIdAndCodeMap.put("visitCode", benVisitCode); + } } return visitIdAndCodeMap; } @@ -558,6 +636,7 @@ public String getBenVisitDetailsFrmNurseCovid19(Long benRegID, Long visitCode) { resMap.put("covid19NurseVisitDetail", gson.toJson(visitDetail)); resMap.put("covidDetails", new Gson().toJson(covid19BenFeedback)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); // resMap.put("BenAdherence", commonNurseServiceImpl.getBenAdherence(benRegID, visitCode)); // @@ -640,6 +719,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + public Integer saveCovidDetails(Covid19BenFeedback covid19BenFeedbackOBJ) { if (covid19BenFeedbackOBJ != null && covid19BenFeedbackOBJ.getSymptoms() != null @@ -940,6 +1028,8 @@ public String getBenCovidNurseData(Long benRegID, Long visitCode) throws IEMRExc resMap.put("history", getBenCovid19HistoryDetails(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); + return resMap.toString(); } @@ -1008,11 +1098,12 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E && !requestOBJ.get("diagnosis").getAsJsonObject().get("doctorDiagnosis").isJsonNull()) { doctorDiagnosis = requestOBJ.get("diagnosis").getAsJsonObject().get("doctorDiagnosis").getAsString(); } - + String prescription_counsellingProvided = null; if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { - prescription_counsellingProvided = requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString(); + prescription_counsellingProvided = requestOBJ.getAsJsonObject().get("counsellingProvidedList") + .getAsString(); } // generate prescription @@ -1133,7 +1224,6 @@ public String getBenCaseRecordFromDoctorCovid19(Long benRegID, Long visitCode) { } } - resMap.put("investigation", commonDoctorServiceImpl.getInvestigationDetails(benRegID, visitCode)); resMap.put("prescription", commonDoctorServiceImpl.getPrescribedDrugs(benRegID, visitCode)); @@ -1265,12 +1355,13 @@ public Long updateCovid19DoctorData(JsonObject requestOBJ, String Authorization) if (!commonUtilityClass.getIsSpecialist() && doctorDiagnosis != null) prescriptionDetail.setDiagnosisProvided(doctorDiagnosis); } - + if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { - prescriptionDetail.setCounsellingProvided(requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString()); - } else - prescriptionDetail.setCounsellingProvided(""); + prescriptionDetail.setCounsellingProvided( + requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString()); + } else + prescriptionDetail.setCounsellingProvided(""); // update prescription if (prescriptionDetail != null) { diff --git a/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java b/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java index 3bcca6ef..90862779 100644 --- a/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java @@ -44,6 +44,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; @@ -329,6 +330,78 @@ private Map saveBenVisitDetails(JsonObject visitDetailsOBJ, Common commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); } + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis(presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); + } + } visitIdAndCodeMap.put("visitID", benVisitID); @@ -389,6 +462,8 @@ public String getBenVisitDetailsFrmNurseFP(Long benRegID, Long visitCode) throws resMap.put("BenChiefComplaints", commonNurseServiceImpl.getBenChiefComplaints(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -404,6 +479,15 @@ public String getBeneficiaryVitalDetailsFP(Long beneficiaryRegID, Long visitCode return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + @Override public String getBeneficiaryFPDetailsFP(Long beneficiaryRegID, Long visitCode) throws Exception { Map resMap = new HashMap<>(); @@ -621,12 +705,13 @@ public Long updateDoctorDataFP(JsonObject requestOBJ, String Authorization) thro commonUtilityClass.setPrescriptionID(prescriptionDetail.getPrescriptionID()); } - + if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { - prescriptionDetail.setCounsellingProvided(requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString()); - } else - prescriptionDetail.setCounsellingProvided(""); + prescriptionDetail.setCounsellingProvided( + requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString()); + } else + prescriptionDetail.setCounsellingProvided(""); // update prescription int p = commonNurseServiceImpl.updatePrescription(prescriptionDetail); @@ -710,7 +795,7 @@ public int saveDoctorDataFP(JsonObject requestOBJ, String Authorization) throws // Integer tcRequestStatusFlag = null; if (requestOBJ != null) { - + TeleconsultationRequestOBJ tcRequestOBJ = null; CommonUtilityClass commonUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); @@ -765,12 +850,13 @@ public int saveDoctorDataFP(JsonObject requestOBJ, String Authorization) throws prescriptionDetail.setExternalInvestigation(wrapperBenInvestigationANC.getExternalInvestigations()); if (commonUtilityClass.getTreatmentsOnSideEffects() != null) prescriptionDetail.setTreatmentsOnSideEffects(commonUtilityClass.getTreatmentsOnSideEffects()); - + if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { - prescriptionDetail.setCounsellingProvided(requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString()); + prescriptionDetail.setCounsellingProvided( + requestOBJ.getAsJsonObject().get("counsellingProvidedList").getAsString()); } - + prescriptionID = commonNurseServiceImpl.saveBenPrescription(prescriptionDetail); // save prescribed lab test @@ -873,7 +959,7 @@ public String getBenCaseRecordFromDoctorFP(Long benRegID, Long visitCode) throws PrescriptionDetail pd = new Gson().fromJson(diagnosis_prescription, PrescriptionDetail.class); if (pd != null && pd.getTreatmentsOnSideEffects() != null) resMap.put("treatmentsOnSideEffects", new Gson().toJson(pd.getTreatmentsOnSideEffects())); - if (pd != null && pd.getCounsellingProvided() != null) + if (pd != null && pd.getCounsellingProvided() != null) resMap.put("counsellingProvidedList", new Gson().toJson(pd.getCounsellingProvided())); } @@ -905,6 +991,7 @@ public String getNurseDataFP(Long benRegID, Long visitCode) throws Exception { resMap.put("fpData", getBeneficiaryFPDetailsFP(benRegID, visitCode)); resMap.put("vitals", getBeneficiaryVitalDetailsFP(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); return resMap.toString(); } diff --git a/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java b/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java index 60277646..2b1dfa99 100644 --- a/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java @@ -64,11 +64,13 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; + import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; @@ -133,7 +135,7 @@ public String saveNurseData(JsonObject requestOBJ, String Authorization) throws nurseUtilityClass.setVisitCode(benVisitCode); nurseUtilityClass.setBenVisitID(benVisitID); - }else { + } else { Map responseMap = new HashMap(); responseMap.put("response", "Data already saved"); return new Gson().toJson(responseMap); @@ -245,42 +247,120 @@ public Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonU // Save Beneficiary visit details BeneficiaryVisitDetail benVisitDetailsOBJ = InputMapper.gson().fromJson(visitDetailsOBJ.get("visitDetails"), BeneficiaryVisitDetail.class); - int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); - if(i<1) { - benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); - - // 07-06-2018 visit code - Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), - nurseUtilityClass.getSessionID()); - - if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { - if (visitDetailsOBJ.has("chiefComplaints") && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { - BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() - .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); - - List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); - if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { - for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { - benChiefComplaint.setBenVisitID(benVisitID); - benChiefComplaint.setVisitCode(benVisitCode); + int i = commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(), + benVisitDetailsOBJ.getVisitReason(), benVisitDetailsOBJ.getVisitCategory()); + if (i < 1) { + benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + + // 07-06-2018 visit code + Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), + nurseUtilityClass.getSessionID()); + + if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { + if (visitDetailsOBJ.has("chiefComplaints") + && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { + BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() + .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); + + List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); + if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { + for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { + benChiefComplaint.setBenVisitID(benVisitID); + benChiefComplaint.setVisitCode(benVisitCode); + } } + // Save Beneficiary Chief Complaints + commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); + } + + if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { + // Save Ben Adherence + BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), + BenAdherence.class); + benAdherence.setBenVisitID(benVisitID); + benAdherence.setVisitCode(benVisitCode); + commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); + } + + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis( + presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null + && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null + && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); } - // Save Beneficiary Chief Complaints - commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); - } - if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { - // Save Ben Adherence - BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), - BenAdherence.class); - benAdherence.setBenVisitID(benVisitID); - benAdherence.setVisitCode(benVisitCode); - commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); } + visitIdAndCodeMap.put("visitID", benVisitID); + visitIdAndCodeMap.put("visitCode", benVisitCode); } - visitIdAndCodeMap.put("visitID", benVisitID); - visitIdAndCodeMap.put("visitCode", benVisitCode); - } } return visitIdAndCodeMap; } @@ -885,6 +965,8 @@ public String getBenVisitDetailsFrmNurseGOPD(Long benRegID, Long visitCode) { resMap.put("BenChiefComplaints", commonNurseServiceImpl.getBenChiefComplaints(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -923,6 +1005,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long benVisitID) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + public String getExaminationDetailsData(Long benRegID, Long visitCode) throws IEMRException { Map examinationDetailsMap = new HashMap(); @@ -1243,6 +1334,7 @@ public String getBenGeneralOPDNurseData(Long benRegID, Long visitCode) throws Ex resMap.put("examination", getExaminationDetailsData(benRegID, visitCode)); resMap.put("vitals", getBeneficiaryVitalDetails(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); return resMap.toString(); } @@ -1358,7 +1450,7 @@ public Long updateGeneralOPDDoctorData(JsonObject requestOBJ, String Authorizati if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { PrescriptionDetail tempPrescription = InputMapper.gson().fromJson(requestOBJ, PrescriptionDetail.class); - + if (tempPrescription != null && tempPrescription.getCounsellingProvidedList() != null && tempPrescription.getCounsellingProvidedList().length > 0) { StringBuffer sb = new StringBuffer(); @@ -1368,8 +1460,8 @@ public Long updateGeneralOPDDoctorData(JsonObject requestOBJ, String Authorizati if (sb.length() >= 2) prescriptionDetail.setCounsellingProvided(sb.substring(0, sb.length() - 2)); - } else - prescriptionDetail.setCounsellingProvided(""); + } else + prescriptionDetail.setCounsellingProvided(""); } // update prescription diff --git a/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java b/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java index 6556fbb9..adbb28c5 100644 --- a/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java @@ -65,7 +65,7 @@ public class LocationServiceImpl implements LocationService { private CountryMasterRepo countryMasterRepo; @Autowired private CountryCityMasterRepo countryCityMasterRepo; - + @Autowired private LocationMasterRepo locationMasterRepo; @@ -133,7 +133,6 @@ public void setZoneMasterRepo(ZoneMasterRepo zoneMasterRepo) { public void setStateMasterRepo(StateMasterRepo stateMasterRepo) { this.stateMasterRepo = stateMasterRepo; } - @Override public String getCountryList() { @@ -158,7 +157,7 @@ public String getStateList() { ArrayList stateMasterList = stateMasterRepo.getStateMaster(); if (stateMasterList != null && stateMasterList.size() > 0) { for (Object[] objArr : stateMasterList) { - States states = new States((Integer) objArr[0], (String) objArr[1],(Integer) objArr[2]); + States states = new States((Integer) objArr[0], (String) objArr[1], (Integer) objArr[2]); stateList.add(states); } } @@ -184,26 +183,28 @@ public String getDistrictList(Integer stateID) { ArrayList districtMasterList = districtMasterRepo.getDistrictMaster(stateID); if (districtMasterList != null && districtMasterList.size() > 0) { for (Object[] objArr : districtMasterList) { - Districts districtMaster = new Districts((Integer) objArr[0], (String) objArr[1],(Integer) objArr[2],(Integer) objArr[3]); + Districts districtMaster = new Districts((Integer) objArr[0], (String) objArr[1], (Integer) objArr[2], + (Integer) objArr[3]); districtList.add(districtMaster); } } return new Gson().toJson(districtList); } - + @Override public String getLocationMasterData(Integer villageID) { LocationDetails locDetail = new LocationDetails(); List locationMasterList = locationMasterRepo.getLocationMaster(villageID); if (locationMasterList != null && locationMasterList.size() > 0) { Object[] objArr = locationMasterList.get(0); - locDetail = new LocationDetails((Integer) objArr[0], (String) objArr[1], (Integer) objArr[2], (String) objArr[3], (Integer) objArr[4], (String) objArr[5], (Integer) objArr[6], (String) objArr[7], (Integer) objArr[8], (String) objArr[9]); - + locDetail = new LocationDetails((Integer) objArr[0], (String) objArr[1], (Integer) objArr[2], + (String) objArr[3], (Integer) objArr[4], (String) objArr[5], (Integer) objArr[6], + (String) objArr[7], (Integer) objArr[8], (String) objArr[9]); + } return new Gson().toJson(locDetail); - - } + } @Override public String getDistrictBlockList(Integer districtID) { @@ -211,7 +212,8 @@ public String getDistrictBlockList(Integer districtID) { ArrayList districtBlockMasterList = districtBlockMasterRepo.getDistrictBlockMaster(districtID); if (districtBlockMasterList != null && districtBlockMasterList.size() > 0) { for (Object[] objArr : districtBlockMasterList) { - DistrictBlock districtBLockMaster = new DistrictBlock((Integer) objArr[0], (String) objArr[1],(Integer) objArr[2],(Integer) objArr[3]); + DistrictBlock districtBLockMaster = new DistrictBlock((Integer) objArr[0], (String) objArr[1], + (Integer) objArr[2], (Integer) objArr[3]); districtBlockList.add(districtBLockMaster); } } @@ -219,7 +221,7 @@ public String getDistrictBlockList(Integer districtID) { } @Override - public String getVillageListByDistrictID(Integer districtID){ + public String getVillageListByDistrictID(Integer districtID) { ArrayList villageList = new ArrayList<>(); ArrayList districtBlockMasterList = districtBlockMasterRepo.getDistrictBlockMaster(districtID); if (districtBlockMasterList != null && districtBlockMasterList.size() > 0) { @@ -278,7 +280,7 @@ public String getLocDetails(Integer spID, Integer spPSMID) { ArrayList stateMasterList = stateMasterRepo.getStateMaster(); if (stateMasterList != null && stateMasterList.size() > 0) { for (Object[] objArr : stateMasterList) { - States states = new States((Integer) objArr[0], (String) objArr[1],(Integer) objArr[2]); + States states = new States((Integer) objArr[0], (String) objArr[1], (Integer) objArr[2]); stateList.add(states); } } @@ -317,7 +319,7 @@ public String getLocDetailsNew(Integer vanID, Integer spPSMID) { ArrayList stateMasterList = stateMasterRepo.getStateMaster(); if (stateMasterList != null && stateMasterList.size() > 0) { for (Object[] objArr : stateMasterList) { - States states = new States((Integer) objArr[0], (String) objArr[1],(Integer) objArr[2]); + States states = new States((Integer) objArr[0], (String) objArr[1], (Integer) objArr[2]); stateList.add(states); } } @@ -343,17 +345,23 @@ private Map getDefaultLocDetails(ArrayList objList) { distMap.put("districtName", objList.get(0)[3]); distMap.put("blockId", objList.get(0)[4]); distMap.put("blockName", objList.get(0)[5]); - - for(Object[] objArr : objList) { - String[] villageIds = objArr[6].toString().split(","); - String[] villageNames = objArr[7].toString().split(","); - int villageIdSize = villageIds.length; - for (int i = 0; i < villageIdSize; i++) { - villageMap = new HashMap<>(); - villageMap.put("districtBranchID", villageIds[i]); - villageMap.put("villageName", villageNames[i]); - villageList.add(villageMap); - } + + for (Object[] objArr : objList) { + + if (objArr[6] != null && objArr[7] != null) { + String[] villageIds = objArr[6].toString().split(","); + String[] villageNames = objArr[7].toString().split(","); + int villageIdSize = villageIds.length; + int villageNameSize = villageNames.length; + for (int i = 0; i < villageIdSize; i++) { + for (int j = 0; j < villageNameSize; j++) { + villageMap = new HashMap<>(); + villageMap.put("districtBranchID", villageIds[i]); + villageMap.put("villageName", villageNames[j]); + villageList.add(villageMap); + } + } + } } distMap.put("villageList", villageList); distLit.add(distMap); diff --git a/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java b/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java index 71b9b927..223f5d57 100644 --- a/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java @@ -57,6 +57,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; @@ -135,7 +136,7 @@ public String saveNCDCareNurseData(JsonObject requestOBJ, String Authorization) nurseUtilityClass.setVisitCode(benVisitCode); nurseUtilityClass.setBenVisitID(benVisitID); - }else { + } else { Map responseMap = new HashMap(); responseMap.put("response", "Data already saved"); return new Gson().toJson(responseMap); @@ -266,47 +267,124 @@ public Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonU BeneficiaryVisitDetail benVisitDetailsOBJ = InputMapper.gson().fromJson(visitDetailsOBJ.get("visitDetails"), BeneficiaryVisitDetail.class); - int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); - if(i<1) { - benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); - - // 11-06-2018 visit code - Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), - nurseUtilityClass.getSessionID()); - - if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { - if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { - // Save Ben Adherence - BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), - BenAdherence.class); - benAdherence.setBenVisitID(benVisitID); - benAdherence.setVisitCode(benVisitCode); - adherenceSuccessFlag = commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); - } - if (visitDetailsOBJ.has("investigation") && !visitDetailsOBJ.get("investigation").isJsonNull()) { - // Save Ben Investigations - WrapperBenInvestigationANC wrapperBenInvestigationANC = InputMapper.gson() - .fromJson(visitDetailsOBJ.get("investigation"), WrapperBenInvestigationANC.class); - - if (wrapperBenInvestigationANC != null) { - wrapperBenInvestigationANC.setBenVisitID(benVisitID); - wrapperBenInvestigationANC.setVisitCode(benVisitCode); - investigationSuccessFlag = commonNurseServiceImpl - .saveBenInvestigationDetails(wrapperBenInvestigationANC); - - } else { - // Invalid Data.. + int i = commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(), + benVisitDetailsOBJ.getVisitReason(), benVisitDetailsOBJ.getVisitCategory()); + if (i < 1) { + benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + + // 11-06-2018 visit code + Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), + nurseUtilityClass.getSessionID()); + + if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { + if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { + // Save Ben Adherence + BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), + BenAdherence.class); + benAdherence.setBenVisitID(benVisitID); + benAdherence.setVisitCode(benVisitCode); + adherenceSuccessFlag = commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); + } + if (visitDetailsOBJ.has("investigation") && !visitDetailsOBJ.get("investigation").isJsonNull()) { + // Save Ben Investigations + WrapperBenInvestigationANC wrapperBenInvestigationANC = InputMapper.gson() + .fromJson(visitDetailsOBJ.get("investigation"), WrapperBenInvestigationANC.class); + + if (wrapperBenInvestigationANC != null) { + wrapperBenInvestigationANC.setBenVisitID(benVisitID); + wrapperBenInvestigationANC.setVisitCode(benVisitCode); + investigationSuccessFlag = commonNurseServiceImpl + .saveBenInvestigationDetails(wrapperBenInvestigationANC); + + } else { + // Invalid Data.. + } + } + + if (adherenceSuccessFlag > 0 && investigationSuccessFlag > 0) { + // Adherence and Investigation Details stored successfully. + } + + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis( + presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null + && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null + && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); } - } - if (adherenceSuccessFlag > 0 && investigationSuccessFlag > 0) { - // Adherence and Investigation Details stored successfully. } - } - visitIdAndCodeMap.put("visitID", benVisitID); - visitIdAndCodeMap.put("visitCode", benVisitCode); - } + visitIdAndCodeMap.put("visitID", benVisitID); + visitIdAndCodeMap.put("visitCode", benVisitCode); + } } return visitIdAndCodeMap; } @@ -610,6 +688,8 @@ public String getBenVisitDetailsFrmNurseNCDCare(Long benRegID, Long visitCode) { resMap.put("Investigation", commonNurseServiceImpl.getLabTestOrders(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -647,6 +727,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + /* * // ------- Fetch beneficiary all past history data ------------------ public * String getPastHistoryData(Long beneficiaryRegID) { return @@ -1144,6 +1233,8 @@ public String getBenNCDCareNurseData(Long benRegID, Long visitCode) throws IEMRE resMap.put("history", getBenNCDCareHistoryDetails(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); + return resMap.toString(); } diff --git a/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java b/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java index 33262908..66745dcf 100644 --- a/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java @@ -67,6 +67,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; @@ -199,7 +200,7 @@ public String saveNCDScreeningNurseData(JsonObject requestOBJ, String Authorizat nurseUtilityClass.setVisitCode(benVisitCode); nurseUtilityClass.setBenVisitID(benVisitID); - }else { + } else { Map responseMap = new HashMap(); responseMap.put("response", "Data already saved"); return new Gson().toJson(responseMap); @@ -457,33 +458,111 @@ public Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonU BeneficiaryVisitDetail benVisitDetailsOBJ = InputMapper.gson().fromJson(visitDetailsOBJ.get("visitDetails"), BeneficiaryVisitDetail.class); - int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); - if(i<1) { - benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); - - // 11-06-2018 visit code - Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), - nurseUtilityClass.getSessionID()); - - if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { - if (visitDetailsOBJ.has("chiefComplaints") && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { - BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() - .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); - - List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); - if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { - for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { - benChiefComplaint.setBenVisitID(benVisitID); - benChiefComplaint.setVisitCode(benVisitCode); + int i = commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(), + benVisitDetailsOBJ.getVisitReason(), benVisitDetailsOBJ.getVisitCategory()); + if (i < 1) { + benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + + // 11-06-2018 visit code + Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), + nurseUtilityClass.getSessionID()); + + if (benVisitID != null && benVisitID > 0 && benVisitCode != null && benVisitCode > 0) { + if (visitDetailsOBJ.has("chiefComplaints") + && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { + BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() + .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); + + List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); + if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { + for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { + benChiefComplaint.setBenVisitID(benVisitID); + benChiefComplaint.setVisitCode(benVisitCode); + } } + // Save Beneficiary Chief Complaints + commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); } - // Save Beneficiary Chief Complaints - commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); + + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis( + presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null + && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null + && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); + } + } + visitIdAndCodeMap.put("visitID", benVisitID); + visitIdAndCodeMap.put("visitCode", benVisitCode); } - visitIdAndCodeMap.put("visitID", benVisitID); - visitIdAndCodeMap.put("visitCode", benVisitCode); - } } return visitIdAndCodeMap; } @@ -1243,7 +1322,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E // Save Prescription prescriptionDetail.setExternalInvestigation(wrapperBenInvestigationANC.getExternalInvestigations()); - + if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { PrescriptionDetail tempPrescription = InputMapper.gson().fromJson(requestOBJ, PrescriptionDetail.class); @@ -1259,7 +1338,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E } } - + prescriptionID = commonNurseServiceImpl.saveBenPrescription(prescriptionDetail); // save prescribed lab test @@ -1385,6 +1464,8 @@ public String getBenVisitDetailsFrmNurseNCDScreening(Long benRegID, Long visitCo resMap.put("BenChiefComplaints", commonNurseServiceImpl.getBenChiefComplaints(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -1397,7 +1478,6 @@ public String getBenHistoryDetails(Long benRegID, Long visitCode) { commonNurseServiceImpl.getPhysicalActivityType(benRegID, visitCode)); HistoryDetailsMap.put("PersonalHistory", commonNurseServiceImpl.getPersonalHistory(benRegID, visitCode)); - return new Gson().toJson(HistoryDetailsMap); } @@ -1420,6 +1500,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long benVisitID) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + @Override public Integer UpdateNCDScreeningHistory(JsonObject historyOBJ) throws Exception { @@ -1452,7 +1541,7 @@ public Integer UpdateNCDScreeningHistory(JsonObject historyOBJ) throws Exception if (familyHistorySuccessFlag > 0 && physicalActivitySuccessFlag > 0) { historyUpdatedSuccessfully = 1; } - + // Update Personal History if (historyOBJ != null && historyOBJ.has("personalHistory") && !historyOBJ.get("personalHistory").isJsonNull()) { @@ -1468,7 +1557,7 @@ public Integer UpdateNCDScreeningHistory(JsonObject historyOBJ) throws Exception commonNurseServiceImpl.updateBenAllergicHistory(benAllergyHistory); } - + return historyUpdatedSuccessfully; } @@ -1480,9 +1569,11 @@ public String getBenNCDScreeningNurseData(Long benRegID, Long visitCode) throws resMap.put("history", getBenHistoryDetails(benRegID, visitCode)); resMap.put("idrs", getBenIdrsDetailsFrmNurse(benRegID, visitCode)); - + resMap.put("cbac", getCbacData(benRegID, visitCode)); - + + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); + DiabetesScreening diabetesScreening = diabetesScreeningRepo.findByBeneficiaryRegIdAndVisitcode(benRegID, visitCode); HypertensionScreening hypertensionScreening = hypertensionScreeningRepo diff --git a/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java b/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java index a413164d..48461846 100644 --- a/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java @@ -48,6 +48,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; @@ -435,6 +436,79 @@ private Map saveBenVisitDetails(JsonObject visitDetailsOBJ, Common // Save Beneficiary Chief Complaints commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); } + + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis(presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); + + } + + commonNurseServiceImpl.saveCdssDetails(cdss); + } + } visitIdAndCodeMap.put("visitID", benVisitID); visitIdAndCodeMap.put("visitCode", benVisitCode); @@ -508,6 +582,8 @@ public String getBenVisitDetailsFrmNurseNNI(Long benRegID, Long visitCode) throw resMap.put("BenChiefComplaints", commonNurseServiceImpl.getBenChiefComplaints(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -523,6 +599,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + @Override public String getBirthAndImmuniHistory(Long benRegID, Long visitCode) throws IEMRException { Map HistoryDetailsMap = new HashMap(); @@ -535,7 +620,8 @@ public String getBirthAndImmuniHistory(Long benRegID, Long visitCode) throws IEM throw new IEMRException("no previous information found. please capture latest information"); } - HistoryDetailsMap.put("immunizationHistory", commonNurseServiceImpl.getImmunizationHistory(benRegID, visitCode)); + HistoryDetailsMap.put("immunizationHistory", + commonNurseServiceImpl.getImmunizationHistory(benRegID, visitCode)); InfantBirthDetails ibObj = infantBirthDetailsRepo.findByBeneficiaryRegIDAndVisitCode(benRegID, visitCode); if (ibObj != null && ibObj.getId() != null && ibObj.getId() > 0) { @@ -645,6 +731,7 @@ public String getNurseDataNNI(Long benRegID, Long visitCode) throws Exception { resMap.put("history", getBirthAndImmuniHistory(benRegID, visitCode)); resMap.put("vitals", getBeneficiaryVitalDetails(benRegID, visitCode)); resMap.put("immunizationServices", getBeneficiaryImmunizationServiceDetails(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); return resMap.toString(); } diff --git a/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java b/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java index e9f4aff0..df8b7f4f 100644 --- a/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java @@ -62,6 +62,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.pnc.PNCCare; import com.iemr.hwc.data.pnc.PNCDiagnosis; @@ -153,7 +154,7 @@ public String savePNCNurseData(JsonObject requestOBJ, String Authorization) thro nurseUtilityClass.setVisitCode(benVisitCode); nurseUtilityClass.setBenVisitID(benVisitID); - }else { + } else { Map responseMap = new HashMap(); responseMap.put("response", "Data already saved"); return new Gson().toJson(responseMap); @@ -325,7 +326,7 @@ public Long savePNCDoctorData(JsonObject requestOBJ, String Authorization) throw && !requestOBJ.get("diagnosis").getAsJsonObject().get("specialistDiagnosis").isJsonNull()) { instruction = requestOBJ.get("diagnosis").getAsJsonObject().get("specialistDiagnosis").getAsString(); } - + String prescription_counsellingProvided = null; if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { @@ -343,7 +344,7 @@ public Long savePNCDoctorData(JsonObject requestOBJ, String Authorization) throw } } - + // generating prescription WrapperBenInvestigationANC wrapperBenInvestigationANC = InputMapper.gson() .fromJson(requestOBJ.get("investigation"), WrapperBenInvestigationANC.class); @@ -351,7 +352,8 @@ public Long savePNCDoctorData(JsonObject requestOBJ, String Authorization) throw wrapperBenInvestigationANC.getBeneficiaryRegID(), wrapperBenInvestigationANC.getBenVisitID(), wrapperBenInvestigationANC.getProviderServiceMapID(), wrapperBenInvestigationANC.getCreatedBy(), wrapperBenInvestigationANC.getExternalInvestigations(), wrapperBenInvestigationANC.getVisitCode(), - wrapperBenInvestigationANC.getVanID(), wrapperBenInvestigationANC.getParkingPlaceID(), instruction, prescription_counsellingProvided, null); + wrapperBenInvestigationANC.getVanID(), wrapperBenInvestigationANC.getParkingPlaceID(), instruction, + prescription_counsellingProvided, null); // save diagnosis if (requestOBJ.has("diagnosis") && !requestOBJ.get("diagnosis").isJsonNull()) { @@ -453,43 +455,120 @@ public Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonU BeneficiaryVisitDetail benVisitDetailsOBJ = InputMapper.gson().fromJson(visitDetailsOBJ.get("visitDetails"), BeneficiaryVisitDetail.class); - int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); - if(i<1) { - benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + int i = commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(), + benVisitDetailsOBJ.getVisitReason(), benVisitDetailsOBJ.getVisitCategory()); + if (i < 1) { + benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + + // 11-06-2018 visit code + Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), + nurseUtilityClass.getSessionID()); + + if (benVisitID != null && benVisitID > 0) { + if (visitDetailsOBJ.has("chiefComplaints") + && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { + // Save Ben Chief Complaints + BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() + .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); + + List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); + if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { + for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { + benChiefComplaint.setBenVisitID(benVisitID); + benChiefComplaint.setVisitCode(benVisitCode); + } + } + commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); + } + if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { + // Save Ben Adherence + BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), + BenAdherence.class); + benAdherence.setBenVisitID(benVisitID); + benAdherence.setVisitCode(benVisitCode); + commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); + } - // 11-06-2018 visit code - Long benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), - nurseUtilityClass.getSessionID()); + // TODO Save Ben Upload Files + if (visitDetailsOBJ.has("cdss") && !visitDetailsOBJ.get("cdss").isJsonNull()) { + JsonObject cdssObj = visitDetailsOBJ.getAsJsonObject("cdss"); + CDSS cdss = InputMapper.gson().fromJson(cdssObj, CDSS.class); + cdss.setBenVisitID(benVisitID); + cdss.setVisitCode(benVisitCode); + + if (cdssObj.has("presentChiefComplaintDb")) { + JsonObject presentCheifComplaintObj = cdssObj.getAsJsonObject("presentChiefComplaintDb"); + + if (presentCheifComplaintObj.get("selectedDiagnosisID") != null + && !presentCheifComplaintObj.get("selectedDiagnosisID").isJsonNull()) + cdss.setSelectedDiagnosisID( + presentCheifComplaintObj.get("selectedDiagnosisID").getAsString()); + if (presentCheifComplaintObj.get("selectedDiagnosis") != null + && !presentCheifComplaintObj.get("selectedDiagnosis").isJsonNull()) + cdss.setSelectedDiagnosis( + presentCheifComplaintObj.get("selectedDiagnosis").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaint") != null + && !presentCheifComplaintObj.get("presentChiefComplaint").isJsonNull()) + cdss.setPresentChiefComplaint( + presentCheifComplaintObj.get("presentChiefComplaint").getAsString()); + if (presentCheifComplaintObj.get("presentChiefComplaintID") != null + && !presentCheifComplaintObj.get("presentChiefComplaintID").isJsonNull()) + cdss.setPresentChiefComplaintID( + presentCheifComplaintObj.get("presentChiefComplaintID").getAsString()); + if (presentCheifComplaintObj.get("algorithmPc") != null + && !presentCheifComplaintObj.get("algorithmPc").isJsonNull()) + cdss.setAlgorithmPc(presentCheifComplaintObj.get("algorithmPc").getAsString()); + if (presentCheifComplaintObj.get("recommendedActionPc") != null + && !presentCheifComplaintObj.get("recommendedActionPc").isJsonNull()) + cdss.setRecommendedActionPc( + presentCheifComplaintObj.get("recommendedActionPc").getAsString()); + if (presentCheifComplaintObj.get("remarksPc") != null + && !presentCheifComplaintObj.get("remarksPc").isJsonNull()) + cdss.setRemarksPc(presentCheifComplaintObj.get("remarksPc").getAsString()); + if (presentCheifComplaintObj.get("actionPc") != null + && !presentCheifComplaintObj.get("actionPc").isJsonNull()) + cdss.setActionPc(presentCheifComplaintObj.get("actionPc").getAsString()); + if (presentCheifComplaintObj.get("actionIdPc") != null + && !presentCheifComplaintObj.get("actionIdPc").isJsonNull()) + cdss.setActionIdPc(presentCheifComplaintObj.get("actionIdPc").getAsInt()); + } + + if (cdssObj.has("diseaseSummaryDb")) { + JsonObject diseaseSummaryObj = cdssObj.getAsJsonObject("diseaseSummaryDb"); + if (diseaseSummaryObj.get("diseaseSummary") != null + && !diseaseSummaryObj.get("diseaseSummary").isJsonNull()) + cdss.setDiseaseSummary(diseaseSummaryObj.get("diseaseSummary").getAsString()); + if (diseaseSummaryObj.get("diseaseSummaryID") != null + && !diseaseSummaryObj.get("diseaseSummaryID").isJsonNull()) + cdss.setDiseaseSummaryID(diseaseSummaryObj.get("diseaseSummaryID").getAsInt()); + if (diseaseSummaryObj.get("algorithm") != null + && !diseaseSummaryObj.get("algorithm").isJsonNull()) + cdss.setAlgorithm(diseaseSummaryObj.get("algorithm").getAsString()); + if (diseaseSummaryObj.get("recommendedAction") != null + && !diseaseSummaryObj.get("recommendedAction").isJsonNull()) + cdss.setRecommendedAction(diseaseSummaryObj.get("recommendedAction").getAsString()); + if (diseaseSummaryObj.get("remarks") != null + && !diseaseSummaryObj.get("remarks").isJsonNull()) + cdss.setRemarks(diseaseSummaryObj.get("remarks").getAsString()); + if (diseaseSummaryObj.get("action") != null + && !diseaseSummaryObj.get("action").isJsonNull()) + cdss.setAction(diseaseSummaryObj.get("action").getAsString()); + if (diseaseSummaryObj.get("actionId") != null + && !diseaseSummaryObj.get("actionId").isJsonNull()) + cdss.setActionId(diseaseSummaryObj.get("actionId").getAsInt()); + if (diseaseSummaryObj.get("informationGiven") != null + && !diseaseSummaryObj.get("informationGiven").isJsonNull()) + cdss.setInformationGiven(diseaseSummaryObj.get("informationGiven").getAsString()); - if (benVisitID != null && benVisitID > 0) { - if (visitDetailsOBJ.has("chiefComplaints") && !visitDetailsOBJ.get("chiefComplaints").isJsonNull()) { - // Save Ben Chief Complaints - BenChiefComplaint[] benChiefComplaintArray = InputMapper.gson() - .fromJson(visitDetailsOBJ.get("chiefComplaints"), BenChiefComplaint[].class); - - List benChiefComplaintList = Arrays.asList(benChiefComplaintArray); - if (null != benChiefComplaintList && benChiefComplaintList.size() > 0) { - for (BenChiefComplaint benChiefComplaint : benChiefComplaintList) { - benChiefComplaint.setBenVisitID(benVisitID); - benChiefComplaint.setVisitCode(benVisitCode); } + + commonNurseServiceImpl.saveCdssDetails(cdss); } - commonNurseServiceImpl.saveBenChiefComplaints(benChiefComplaintList); - } - if (visitDetailsOBJ.has("adherence") && !visitDetailsOBJ.get("adherence").isJsonNull()) { - // Save Ben Adherence - BenAdherence benAdherence = InputMapper.gson().fromJson(visitDetailsOBJ.get("adherence"), - BenAdherence.class); - benAdherence.setBenVisitID(benVisitID); - benAdherence.setVisitCode(benVisitCode); - commonNurseServiceImpl.saveBenAdherenceDetails(benAdherence); - } - // TODO Save Ben Upload Files + } + visitIdAndCodeMap.put("visitID", benVisitID); + visitIdAndCodeMap.put("visitCode", benVisitCode); } - visitIdAndCodeMap.put("visitID", benVisitID); - visitIdAndCodeMap.put("visitCode", benVisitCode); - } } return visitIdAndCodeMap; } @@ -938,6 +1017,8 @@ public String getBenVisitDetailsFrmNursePNC(Long benRegID, Long visitCode) { resMap.put("BenChiefComplaints", commonNurseServiceImpl.getBenChiefComplaints(benRegID, visitCode)); + resMap.put("Cdss", commonNurseServiceImpl.getBenCdss(benRegID, visitCode)); + return resMap.toString(); } @@ -993,6 +1074,15 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } + public String getPNCExaminationDetailsData(Long benRegID, Long visitCode) { Map examinationDetailsMap = new HashMap(); @@ -1374,6 +1464,8 @@ public String getBenPNCNurseData(Long benRegID, Long visitCode) throws IEMRExcep resMap.put("examination", getPNCExaminationDetailsData(benRegID, visitCode)); + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); + return resMap.toString(); } @@ -1384,7 +1476,7 @@ public String getBenCaseRecordFromDoctorPNC(Long benRegID, Long visitCode) { String diagnosis_prescription = pncDoctorServiceImpl.getPNCDiagnosisDetails(benRegID, visitCode); resMap.put("diagnosis", diagnosis_prescription); - + if (diagnosis_prescription != null) { PrescriptionDetail pd = new Gson().fromJson(diagnosis_prescription, PrescriptionDetail.class); @@ -1478,13 +1570,12 @@ public Long updatePNCDoctorData(JsonObject requestOBJ, String Authorization) thr if (pncDiagnosis != null && pncDiagnosis.getSpecialistDiagnosis() != null) prescriptionDetail.setInstruction(pncDiagnosis.getSpecialistDiagnosis()); } - + if (requestOBJ.has("counsellingProvidedList") && !requestOBJ.get("counsellingProvidedList").isJsonNull() && requestOBJ.get("counsellingProvidedList") != null) { - + PrescriptionDetail tempPrescription = InputMapper.gson().fromJson(requestOBJ, PrescriptionDetail.class); - - + if (tempPrescription != null && tempPrescription.getCounsellingProvidedList() != null && tempPrescription.getCounsellingProvidedList().length > 0) { StringBuffer sb = new StringBuffer(); @@ -1494,7 +1585,7 @@ public Long updatePNCDoctorData(JsonObject requestOBJ, String Authorization) thr if (sb.length() >= 2) prescriptionDetail.setCounsellingProvided(sb.substring(0, sb.length() - 2)); - }else + } else prescriptionDetail.setCounsellingProvided(""); } // update prescription diff --git a/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java b/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java index 176c8b8f..0b4bce30 100644 --- a/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java @@ -39,6 +39,7 @@ import com.iemr.hwc.data.nurse.BenAnthropometryDetail; import com.iemr.hwc.data.nurse.BenPhysicalVitalDetail; import com.iemr.hwc.data.nurse.BeneficiaryVisitDetail; +import com.iemr.hwc.data.nurse.CDSS; import com.iemr.hwc.data.nurse.CommonUtilityClass; import com.iemr.hwc.data.quickConsultation.BenChiefComplaint; import com.iemr.hwc.data.quickConsultation.BenClinicalObservations; @@ -47,6 +48,8 @@ import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; import com.iemr.hwc.repo.nurse.BenPhysicalVitalRepo; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.repo.quickConsultation.BenClinicalObservationsRepo; import com.iemr.hwc.repo.quickConsultation.ExternalTestOrderRepo; @@ -89,6 +92,10 @@ public class QuickConsultationServiceImpl implements QuickConsultationService { private SMSGatewayServiceImpl sMSGatewayServiceImpl; @Autowired private BenPhysicalVitalRepo benPhysicalVitalRepo; + @Autowired + private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private CDSSRepo cdssRepo; @Override public Long saveBeneficiaryChiefComplaint(JsonObject caseSheet) { @@ -195,12 +202,11 @@ public String quickConsultNurseDataInsert(JsonObject jsnOBJ, String Authorizatio BeneficiaryVisitDetail.class); int i=commonNurseServiceImpl.getMaxCurrentdate(benVisitDetailsOBJ.getBeneficiaryRegID(),benVisitDetailsOBJ.getVisitReason(),benVisitDetailsOBJ.getVisitCategory()); if(i<1) { - Long benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ); + Long benVisitID = commonNurseServiceImpl.saveBeneficiaryVisitDetails(benVisitDetailsOBJ, nurseUtilityClass.getSessionID()); // 11-06-2018 visit code benVisitCode = commonNurseServiceImpl.generateVisitCode(benVisitID, nurseUtilityClass.getVanID(), nurseUtilityClass.getSessionID()); - // Getting benflowID for ben status update Long benFlowID = null; // if (jsnOBJ.has("benFlowID")) { @@ -436,11 +442,15 @@ public String getBenDataFrmNurseToDocVisitDetailsScreen(Long benRegID, Long visi Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); BeneficiaryVisitDetail benVisitDetailsOBJ = commonNurseServiceImpl.getCSVisitDetails(benRegID, visitCode); + CDSS cdssObj = commonNurseServiceImpl.getCdssDetails(benRegID, visitCode); if (null != benVisitDetailsOBJ) { resMap.put("benVisitDetails", benVisitDetailsOBJ); } + if(cdssObj != null) { + resMap.put("cdss", cdssObj); + } return gson.toJson(resMap); } @@ -455,12 +465,23 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode) return resMap.toString(); } + + public String getBeneficiaryCdssDetails(Long beneficiaryRegID, Long benVisitID) { + Map resMap = new HashMap<>(); + + resMap.put("presentChiefComplaint", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + resMap.put("diseaseSummary", commonNurseServiceImpl.getBenCdssDetails(beneficiaryRegID, benVisitID)); + + return resMap.toString(); + } public String getBenQuickConsultNurseData(Long benRegID, Long visitCode) { Map resMap = new HashMap<>(); resMap.put("vitals", getBeneficiaryVitalDetails(benRegID, visitCode)); + + resMap.put("cdss", getBeneficiaryCdssDetails(benRegID, visitCode)); return resMap.toString(); } diff --git a/src/test/java/com/iemr/mmu/anc/TestANCServices.java b/src/test/java/com/iemr/mmu/anc/TestANCServices.java index 406d3e58..7b433ab9 100644 --- a/src/test/java/com/iemr/mmu/anc/TestANCServices.java +++ b/src/test/java/com/iemr/mmu/anc/TestANCServices.java @@ -52,6 +52,7 @@ import com.iemr.hwc.service.anc.ANCServiceImpl; import com.iemr.mmu.common.TestCommonServices; + public class TestANCServices { From 19e9ce3b2d191db0996ede76d23be69ce3e30566 Mon Sep 17 00:00:00 2001 From: Mithun James Date: Fri, 6 Oct 2023 15:29:49 +0530 Subject: [PATCH 18/26] Create CI properties, add maven resources plugin to replace env values (#68) --- .gitignore | 2 + .java-version | 1 + README.md | 5 +- pom.xml | 52 +++++++++-- src/main/environment/common_ci.properties | 89 +++++++++++++++++++ src/main/environment/common_dev.properties | 21 ++--- .../environment/common_example.properties | 23 ++++- src/main/environment/common_prod.properties | 22 +++-- 8 files changed, 177 insertions(+), 38 deletions(-) create mode 100644 .java-version create mode 100644 src/main/environment/common_ci.properties diff --git a/.gitignore b/.gitignore index d961db73..054db182 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ Thumbs.db mvnw.cmd .sts4-cache mvnw + +src/main/environment/common_local.properties \ No newline at end of file diff --git a/.java-version b/.java-version new file mode 100644 index 00000000..62593409 --- /dev/null +++ b/.java-version @@ -0,0 +1 @@ +1.8 diff --git a/README.md b/README.md index e07863f6..959a8d12 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,11 @@ This microservice is built on Java, Spring boot framework and MySQL DB. ### Creating a build configuration in STS / Eclipse +* You can copy `common_example.properties` to `common_local.properties` and edit the file accordingly. The file is under `src/main/environment` folder. * In your editor, click on Run -> Run configuration. -* Double click on Maven build and give a suitable name for the new configuration. +* Double-click on Maven build and give a suitable name for the new configuration. * Populate the base directory by clicking on workspace and selecting HWC-API module. -* Set goals to clean install -DENV_VAR=example(your choice of desired environment) and click on Apply. +* Set goals to clean install -DENV_VAR=local(your choice of desired environment) and click on Apply. * It is advisable have a personal environment properties file under src/main/environment filling out all the placeholders to avoid repetitive manual work each time you run locally. * Click Run to run the build configuration. diff --git a/pom.xml b/pom.xml index c39ab69c..d99049ab 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ ${ENV_VAR} target/classes/application.properties - src/main/environment/common_${environment}.properties + target/classes/common_${environment}.properties @@ -233,7 +233,6 @@ hwc-facility-service - org.apache.maven.plugins @@ -265,32 +264,70 @@ + + org.apache.maven.plugins + maven-resources-plugin + + + filter-resources + process-resources + + resources + + + @ + false + + + src/main/environment + true + + common_${environment}.properties + + + + + + + org.apache.maven.plugins maven-antrun-plugin - 1.8 process-resources run - properties-updated + merge-properties - concatinating properties file ${target-properties} and + concatenating properties file ${target-properties} and ${source-properties} - $${server-password} --> + force="yes"> + + process-resources + + run + + clean-property-files + + + + + + + + @@ -312,7 +349,6 @@ - diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties new file mode 100644 index 00000000..d44e0666 --- /dev/null +++ b/src/main/environment/common_ci.properties @@ -0,0 +1,89 @@ +# CI environment for building war files +# DB Connections +spring.datasource.url=@env.DATABASE_URL@ +spring.datasource.username=@env.DATABASE_USERNAME@ +spring.datasource.password=@env.DATABASE_PASSWORD@ +spring.datasource.driver-class-name=com.mysql.jdbc.Driver + +## Carestream URLs +carestreamOrderCreateURL =@env.COMMON_API_BASE_URL@/carestream/createOrder + +## Identity - Common URLs +# Registration +registrationUrl =@env.COMMON_API_BASE_URL@/beneficiary/create + +syncSearchByLocation =@env.COMMON_API_BASE_URL@/id/searchByDistrictId + +registrarQuickSearchByIdUrl =@env.COMMON_API_BASE_URL@/beneficiary/searchUserByID + +registrarQuickSearchByPhoneNoUrl =@env.COMMON_API_BASE_URL@/beneficiary/searchUserByPhone + +getBenImageFromIdentity =@env.COMMON_API_BASE_URL@/id/benImageByBenRegID + +##save covid Vaccine details coming from mobile app through fhir +saveCovidVaccineDetailsURL = @env.COMMON_API_BASE_URL@/covid/saveCovidVaccinationDetails + +##beneficiary edit +beneficiaryEditUrl =@env.COMMON_API_BASE_URL@/beneficiary/update + +## Advance Search +registrarAdvanceSearchUrl =@env.COMMON_API_BASE_URL@/beneficiary/searchBeneficiary + +## Data Sync API +dataSyncUploadUrl=@env.MMU_API_BASE_URL@/dataSync/van-to-server + +## Data download API +dataSyncDownloadUrl=@env.MMU_API_BASE_URL@/dataSync/server-to-van + +## TC specialist slot booking +tcSpecialistSlotBook=@env.SCHEDULER_API_BASE_URL@/schedule/bookSlot + +## TC specialist slot cancelling +tcSpecialistSlotCancel=@env.SCHEDULER_API_BASE_URL@/schedule/cancelBookedSlot + +## TM sms to beneficiary(schedule, cancel, reschedule) +sendSMSUrl=@env.COMMON_API_BASE_URL@/sms/sendSMS + +### get openkm doc download url +openkmDocUrl=@env.COMMON_API_BASE_URL@/kmfilemanager/getKMFileDownloadURL + +##Fetosense Url +foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother + +## apiKey for calling fetosense api +foetalMonitorAPIKey = @env.FETOSENSE_API_KEY@ + +## TM SMS template details(SMS type) +schedule=TC Schedule SMS +cancel=TC Cancel SMS +reSchedule=TC Reschedule SMS + +snomedCTPageSize=10 + +nurseWL=7 +nurseTCWL=7 +docWL=7 +pharmaWL=7 +labWL=7 +radioWL=7 +oncoWL=7 +tcSpeclistWL=7 + + +servicePointID: 235 +parkingPlaceID: 233 +providerServiceMapID: 1261 +vanID: 220 +serviceID: 4 +providerID: 500 +appId: 85696 +authKey: 8BfRcBAGkTQkbQ6 +authSecret: jgQRyySBGu2YcaJ +scheduling-slotsize=5 +prescription=TMPrescription SMS + +### Redis IP +spring.redis.host=localhost + + + diff --git a/src/main/environment/common_dev.properties b/src/main/environment/common_dev.properties index de056dd4..af6bd2ce 100644 --- a/src/main/environment/common_dev.properties +++ b/src/main/environment/common_dev.properties @@ -3,11 +3,8 @@ spring.datasource.url= spring.datasource.username= spring.datasource.password= - spring.datasource.driver-class-name=com.mysql.jdbc.Driver - - ## Carestream URLs carestreamOrderCreateURL =/hwc-commonapi-v1.0/carestream/createOrder @@ -73,15 +70,15 @@ oncoWL=7 tcSpeclistWL=7 -servicePointID: 235 -parkingPlaceID: 233 -providerServiceMapID: 1261 -vanID: 220 -serviceID: 4 -providerID: 500 -appId: 85696 -authKey: 8BfRcBAGkTQkbQ6 -authSecret: jgQRyySBGu2YcaJ +servicePointID= 235 +parkingPlaceID= 233 +providerServiceMapID= 1261 +vanID= 220 +serviceID= 4 +providerID= 500 +appId= 85696 +authKey= 8BfRcBAGkTQkbQ6 +authSecret= jgQRyySBGu2YcaJ scheduling-slotsize=5 prescription=TMPrescription SMS diff --git a/src/main/environment/common_example.properties b/src/main/environment/common_example.properties index 8388d1f7..3bba37c5 100644 --- a/src/main/environment/common_example.properties +++ b/src/main/environment/common_example.properties @@ -1,5 +1,5 @@ -# local env -# DB Connections +# dev env +# DB Connections spring.datasource.url= spring.datasource.username= spring.datasource.password= @@ -48,8 +48,10 @@ sendSMSUrl=http://localhost:8080/sms/sendSMS openkmDocUrl=http://localhost:8080/kmfilemanager/getKMFileDownloadURL ##Fetosense Url -foetalMonitor-api-url-ANCTestDetails=http://localhost:8080/foetalMonitor/registerMother -#foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother +foetalMonitor-api-url-ANCTestDetails=https://asia-south1-amrit-fetosense.cloudfunctions.net/insertMother + +## apiKey for calling fetosense api +foetalMonitorAPIKey = ## TM SMS template details(SMS type) schedule=TC Schedule SMS @@ -67,6 +69,19 @@ radioWL=7 oncoWL=7 tcSpeclistWL=7 + +servicePointID= 235 +parkingPlaceID= 233 +providerServiceMapID= 1261 +vanID= 220 +serviceID= 4 +providerID= 500 +appId= 85696 +authKey= 8BfRcBAGkTQkbQ6 +authSecret= jgQRyySBGu2YcaJ +scheduling-slotsize=5 +prescription=TMPrescription SMS + ### Redis IP spring.redis.host=localhost diff --git a/src/main/environment/common_prod.properties b/src/main/environment/common_prod.properties index aadcc528..0e5c2824 100644 --- a/src/main/environment/common_prod.properties +++ b/src/main/environment/common_prod.properties @@ -1,12 +1,10 @@ -# Test env +# Prod env # DB Connections spring.datasource.url= spring.datasource.username= spring.datasource.password= spring.datasource.driver-class-name=com.mysql.jdbc.Driver - - ## Carestream URLs carestreamOrderCreateURL =/commonapi-v1.0/carestream/createOrder @@ -74,15 +72,15 @@ oncoWL=7 tcSpeclistWL=7 -servicePointID: 235 -parkingPlaceID: 233 -providerServiceMapID: 1261 -vanID: 220 -serviceID: 4 -providerID: 500 -appId: 85696 -authKey: 8BfRcBAGkTQkbQ6 -authSecret: jgQRyySBGu2YcaJ +servicePointID= 235 +parkingPlaceID= 233 +providerServiceMapID= 1261 +vanID= 220 +serviceID= 4 +providerID= 500 +appId= 85696 +authKey= 8BfRcBAGkTQkbQ6 +authSecret= jgQRyySBGu2YcaJ scheduling-slotsize=5 prescription=TMPrescription SMS From 900650708b381da73de2fb70fb36a1e1b7655518 Mon Sep 17 00:00:00 2001 From: IN40068837 Date: Wed, 11 Oct 2023 12:45:15 +0530 Subject: [PATCH 19/26] New serviceline api modified --- .../hwc/service/location/LocationServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java b/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java index adbb28c5..a5e32057 100644 --- a/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java @@ -354,12 +354,12 @@ private Map getDefaultLocDetails(ArrayList objList) { int villageIdSize = villageIds.length; int villageNameSize = villageNames.length; for (int i = 0; i < villageIdSize; i++) { - for (int j = 0; j < villageNameSize; j++) { - villageMap = new HashMap<>(); - villageMap.put("districtBranchID", villageIds[i]); - villageMap.put("villageName", villageNames[j]); - villageList.add(villageMap); - } + villageMap = new HashMap<>(); + villageMap.put("districtBranchID", villageIds[i]); + if (villageNames.length > i) + villageMap.put("villageName", villageNames[i]); + villageList.add(villageMap); + } } } From c26ff832a402a9d914571f887a020952f51818b3 Mon Sep 17 00:00:00 2001 From: Ravi Shanigarapu Date: Fri, 20 Oct 2023 15:26:43 +0530 Subject: [PATCH 20/26] location mapping changes --- .../controller/location/LocationController.java | 2 +- .../hwc/controller/wo/LocationControllerWo.java | 2 +- .../hwc/data/location/V_getVanLocDetails.java | 3 +++ .../hwc/repo/location/V_getVanLocDetailsRepo.java | 8 ++++++-- .../hwc/service/location/LocationServiceImpl.java | 15 +++++++++++++-- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/iemr/hwc/controller/location/LocationController.java b/src/main/java/com/iemr/hwc/controller/location/LocationController.java index 49f90a6c..06232025 100644 --- a/src/main/java/com/iemr/hwc/controller/location/LocationController.java +++ b/src/main/java/com/iemr/hwc/controller/location/LocationController.java @@ -195,7 +195,7 @@ public String getLocDetailsBasedOnSpIDAndPsmIDNew(@RequestBody String comingRequ JSONObject obj = new JSONObject(comingRequest); if (obj != null && obj.has("vanID") && obj.has("spPSMID") && obj.get("vanID") != null && obj.get("spPSMID") != null) { - String s = locationServiceImpl.getLocDetailsNew(obj.getInt("vanID"), obj.getInt("spPSMID")); + String s = locationServiceImpl.getLocDetailsNew(obj.getInt("vanID"), obj.getInt("spPSMID"),obj); response.setResponse(s); } else { diff --git a/src/main/java/com/iemr/hwc/controller/wo/LocationControllerWo.java b/src/main/java/com/iemr/hwc/controller/wo/LocationControllerWo.java index ab54246d..1732087d 100644 --- a/src/main/java/com/iemr/hwc/controller/wo/LocationControllerWo.java +++ b/src/main/java/com/iemr/hwc/controller/wo/LocationControllerWo.java @@ -142,7 +142,7 @@ public String getLocDetailsBasedOnSpIDAndPsmIDNew(@RequestBody String comingRequ JSONObject obj = new JSONObject(comingRequest); if (obj != null && obj.has("vanID") && obj.has("spPSMID") && obj.get("vanID") != null && obj.get("spPSMID") != null) { - String s = locationServiceImpl.getLocDetailsNew(obj.getInt("vanID"), obj.getInt("spPSMID")); + String s = locationServiceImpl.getLocDetailsNew(obj.getInt("vanID"), obj.getInt("spPSMID"),obj); response.setResponse(s); } else { diff --git a/src/main/java/com/iemr/hwc/data/location/V_getVanLocDetails.java b/src/main/java/com/iemr/hwc/data/location/V_getVanLocDetails.java index fe90dd9b..be5e4476 100644 --- a/src/main/java/com/iemr/hwc/data/location/V_getVanLocDetails.java +++ b/src/main/java/com/iemr/hwc/data/location/V_getVanLocDetails.java @@ -41,6 +41,9 @@ public class V_getVanLocDetails { @Column(name = "VanID") private Integer vanID; @Expose + @Column(name = "userid") + private Integer userID; + @Expose @Column(name = "ParkingPlaceID") private Integer parkingPlaceID; diff --git a/src/main/java/com/iemr/hwc/repo/location/V_getVanLocDetailsRepo.java b/src/main/java/com/iemr/hwc/repo/location/V_getVanLocDetailsRepo.java index dda0e779..2b3a9359 100644 --- a/src/main/java/com/iemr/hwc/repo/location/V_getVanLocDetailsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/location/V_getVanLocDetailsRepo.java @@ -36,7 +36,11 @@ public interface V_getVanLocDetailsRepo extends CrudRepository { @Query(" SELECT distinct t.stateID, t.parkingPlaceID, t.districtID, t.districtName," + "t.blockid, t.blockname, t.villageId, t.villageName, t.govtLGDStateID,t.govtLGDDistrictID" - + " FROM V_getVanLocDetails t WHERE t.vanID = :vanID ") - ArrayList getVanDetails(@Param("vanID") Integer vanID); + + " FROM V_getVanLocDetails t WHERE t.vanID = :vanID and t.userID = :userID ") + ArrayList getVanDetailsWithUserID(@Param("vanID") Integer vanID,@Param("userID") Integer userID); + @Query(" SELECT distinct t.stateID, t.parkingPlaceID, t.districtID, t.districtName," + + "t.blockid, t.blockname, t.villageId, t.villageName, t.govtLGDStateID,t.govtLGDDistrictID" + + " FROM V_getVanLocDetails t WHERE t.vanID = :vanID") + ArrayList getVanDetails(@Param("vanID") Integer vanID); } diff --git a/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java b/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java index a5e32057..13f94650 100644 --- a/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/location/LocationServiceImpl.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.Objects; +import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -304,7 +305,11 @@ public String getLocDetails(Integer spID, Integer spPSMID) { } // new, 11-10-2018 - public String getLocDetailsNew(Integer vanID, Integer spPSMID) { + public String getLocDetailsNew(Integer vanID, Integer spPSMID,JSONObject obj) { + Integer userID = null; + if(obj.has("userID")) { + userID = obj.getInt("userID"); + } Map resMap = new HashMap(); // other location details // ArrayList objList = @@ -312,7 +317,13 @@ public String getLocDetailsNew(Integer vanID, Integer spPSMID) { // spPSMID); // other location details, changed for TM - ArrayList resultSet = v_getVanLocDetailsRepo.getVanDetails(vanID); + ArrayList resultSet = null; + if(null != userID) { + resultSet = v_getVanLocDetailsRepo.getVanDetailsWithUserID(vanID,userID); + }else{ + resultSet = v_getVanLocDetailsRepo.getVanDetails(vanID); + } + // state master ArrayList stateList = new ArrayList<>(); From ba0c43eef688c27b154029c7fa4e1b04da81b830 Mon Sep 17 00:00:00 2001 From: helenKaryamsetty <133211481+helenKaryamsetty@users.noreply.github.com> Date: Mon, 20 Nov 2023 19:12:58 +0530 Subject: [PATCH 21/26] empty change (#79) Co-authored-by: KA40094929 --- src/main/java/com/iemr/hwc/config/SwaggerConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/iemr/hwc/config/SwaggerConfig.java b/src/main/java/com/iemr/hwc/config/SwaggerConfig.java index cd632526..fa2092a9 100644 --- a/src/main/java/com/iemr/hwc/config/SwaggerConfig.java +++ b/src/main/java/com/iemr/hwc/config/SwaggerConfig.java @@ -39,6 +39,7 @@ public Docket productApi() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage("com.iemr.hwc.controller")).build().apiInfo(metaData()); } + private ApiInfo metaData() { ApiInfo apiInfo = new ApiInfo("HWC API", "Health and Wellness centre (HWC) is one of the comprehensive applications of AMRIT designed to capture details of 7 Service packages as per guidelines which should be available at Health and Wellness centre.", From 7424f271ee45c213d057d1fd15d057a702bd7b0a Mon Sep 17 00:00:00 2001 From: "Burdhi. Shivani" Date: Fri, 24 Nov 2023 16:25:19 +0530 Subject: [PATCH 22/26] http insecure changes --- .../config/BlockingHttpMethodInterceptor.java | 36 +++++++++++++++++++ .../iemr/hwc/config/InterceptorConfig.java | 8 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/iemr/hwc/config/BlockingHttpMethodInterceptor.java diff --git a/src/main/java/com/iemr/hwc/config/BlockingHttpMethodInterceptor.java b/src/main/java/com/iemr/hwc/config/BlockingHttpMethodInterceptor.java new file mode 100644 index 00000000..d5e3ec36 --- /dev/null +++ b/src/main/java/com/iemr/hwc/config/BlockingHttpMethodInterceptor.java @@ -0,0 +1,36 @@ +package com.iemr.hwc.config; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +public class BlockingHttpMethodInterceptor implements HandlerInterceptor { + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + String method = request.getMethod(); + if (!("GET".equals(method) || "POST".equals(method))) { + response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + return false; + } + return true; +} + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, + ModelAndView modelAndView) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) + throws Exception { + // TODO Auto-generated method stub + + } +} diff --git a/src/main/java/com/iemr/hwc/config/InterceptorConfig.java b/src/main/java/com/iemr/hwc/config/InterceptorConfig.java index 5129f1e3..7c04a058 100644 --- a/src/main/java/com/iemr/hwc/config/InterceptorConfig.java +++ b/src/main/java/com/iemr/hwc/config/InterceptorConfig.java @@ -34,8 +34,14 @@ public class InterceptorConfig extends WebMvcConfigurerAdapter { @Autowired HTTPRequestInterceptor requestInterceptor; +// @Override +// public void addInterceptors(InterceptorRegistry registry) { +// registry.addInterceptor(requestInterceptor); +// } + @Override public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(requestInterceptor); + registry.addInterceptor(new BlockingHttpMethodInterceptor()) + .addPathPatterns("/**"); } } \ No newline at end of file From 8cc8d7930c31d414efd040c5149ad70a29467b3b Mon Sep 17 00:00:00 2001 From: indraniBan <133205641+indraniBan@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:43:13 +0530 Subject: [PATCH 23/26] Multiple Benificiary visit-api modified for all visit category (#78) * Multiple Benificiary visit-api modified for all visit category * Multiple Ben Visit Api code Modified * TestNcdCareController error resolved * WASA point- Swagger documentation disclosure --------- Co-authored-by: IN40068837 --- .../ChildhoodAdolescenceController.java | 48 +++++++++--------- .../anc/AntenatalCareController.java | 39 ++++++++------- .../CancerScreeningController.java | 35 +++++++------ .../controller/covid19/CovidController.java | 36 ++++++++------ .../FamilyPlanningController.java | 35 +++++++------ .../generalOPD/GeneralOPDController.java | 26 ++++++---- .../controller/ncdCare/NCDCareController.java | 44 ++++++++--------- .../ncdscreening/NCDScreeningController.java | 49 ++++++++++--------- .../neonatal/NeonatalController.java | 43 +++++++++------- .../pnc/PostnatalCareController.java | 37 ++++++++------ .../quickconsult/QuickConsultController.java | 35 +++++++------ .../OralVitaminNoOfDoseMasterRepo.java | 2 + .../T_OralVitaminProphylaxisRepo.java | 2 + .../FPDispenseDetailsRepo.java | 2 + .../FPIecCounsellingDetailsRepo.java | 2 + .../FamilyPlanningReproductiveRepo.java | 2 + .../masterrepo/RelationshipMasterRepo.java | 5 +- .../ncdScreening/BloodGlucoseMasterRepo.java | 2 + .../masterrepo/ncdScreening/CBACRepo.java | 2 + .../ncdScreening/CervicalLympRepo.java | 5 +- .../ncdScreening/InpectionBreastsRepo.java | 5 +- .../ncdScreening/MouthOpeningRepo.java | 5 +- .../ncdScreening/OralCavityFindingRepo.java | 5 +- .../ncdScreening/PalpationBreastsRepo.java | 5 +- .../ncdScreening/PalpationOfLymphRepo.java | 5 +- .../ncdScreening/PalpationOralCavityRepo.java | 5 +- .../ncdScreening/TemperomandibularRepo.java | 5 +- .../ncdScreening/VisualExamRepo.java | 5 +- .../pnc/DeliveryConductedByMasterRepo.java | 2 + .../neonatal/FollowUpForImmunizationRepo.java | 2 + .../neonatal/ImmunizationServicesRepo.java | 2 + .../repo/neonatal/InfantBirthDetailsRepo.java | 2 + .../hwc/repo/nurse/BenVisitDetailRepo.java | 9 ++++ .../com/iemr/hwc/repo/nurse/CDSSRepo.java | 10 ++++ .../hwc/repo/nurse/anc/BenAdherenceRepo.java | 5 ++ .../nurse/covid19/Covid19BenFeedbackRepo.java | 9 ++++ .../BreastCancerScreeningRepo.java | 2 + .../nurse/ncdscreening/CbacDetailsRepo.java | 2 + .../CervicalCancerScreeningRepo.java | 2 + .../ncdscreening/DiabetesScreeningRepo.java | 2 + .../HypertensionScreeningRepo.java | 2 + .../ncdscreening/OralCancerScreeningRepo.java | 2 + .../BenChiefComplaintRepo.java | 5 ++ .../LabTestOrderDetailRepo.java | 5 ++ .../PrescriptionDetailRepo.java | 5 ++ .../hwc/repo/uptsu/M_104ActionMasterRepo.java | 2 + .../AdolescentAndChildCareService.java | 2 + .../AdolescentAndChildCareServiceImpl.java | 31 +++++++++++- .../com/iemr/hwc/service/anc/ANCService.java | 2 + .../iemr/hwc/service/anc/ANCServiceImpl.java | 35 ++++++++++++- .../service/cancerScreening/CSService.java | 2 + .../cancerScreening/CSServiceImpl.java | 34 ++++++++++++- .../transaction/CommonNurseServiceImpl.java | 11 +++-- .../common/transaction/CommonServiceImpl.java | 2 +- .../service/covid19/Covid19ServiceImpl.java | 29 ++++++++++- .../FamilyPlanningService.java | 2 + .../FamilyPlanningServiceImpl.java | 34 ++++++++++++- .../service/generalOPD/GeneralOPDService.java | 2 + .../generalOPD/GeneralOPDServiceImpl.java | 32 +++++++++++- .../hwc/service/ncdCare/NCDCareService.java | 2 + .../service/ncdCare/NCDCareServiceImpl.java | 43 +++++++++++++++- .../ncdscreening/NCDScreeningService.java | 2 + .../ncdscreening/NCDScreeningServiceImpl.java | 32 +++++++++++- .../hwc/service/neonatal/NeonatalService.java | 2 + .../service/neonatal/NeonatalServiceImpl.java | 32 +++++++++++- .../com/iemr/hwc/service/pnc/PNCService.java | 2 + .../iemr/hwc/service/pnc/PNCServiceImpl.java | 35 ++++++++++++- .../QuickConsultationService.java | 2 + .../QuickConsultationServiceImpl.java | 24 +++++++++ .../mmu/ncdCare/TestNCDCareController.java | 2 +- 70 files changed, 742 insertions(+), 215 deletions(-) diff --git a/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java b/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java index 6d12510a..24b49b45 100644 --- a/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java +++ b/src/main/java/com/iemr/hwc/controller/adolescent/ChildhoodAdolescenceController.java @@ -59,33 +59,37 @@ public class ChildhoodAdolescenceController { * @Objective Save child-adolescent-care data for nurse. * @param requestObj * @return success or failure response with visit code + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save child adolescent care (CAC) nurse data", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenNurseDataCAC(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for child-adolescent-care nurse data saving :" + requestObj); - + if (null != requestObj) { + JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); - JsonObject jsnOBJ = jsnElmnt.getAsJsonObject(); - - if (jsnOBJ != null) { - String genOPDRes = adolescentAndChildCareService.saveNurseData(jsnOBJ, Authorization); - response.setResponse(genOPDRes); - - } else { - response.setResponse("Invalid request"); + jsnOBJ = jsnElmnt.getAsJsonObject(); + try { + logger.info("Request object for child-adolescent-care nurse data saving :" + requestObj); + + if (jsnOBJ != null) { + String genOPDRes = adolescentAndChildCareService.saveNurseData(jsnOBJ, Authorization); + response.setResponse(genOPDRes); + + } else { + response.setResponse("Invalid request"); + } + } catch (SQLException e) { + logger.error("Error in nurse data saving :" + e); + response.setError(5000, "Unable to save data : " + e.getLocalizedMessage()); + } catch (Exception e) { + logger.error("Error in nurse data saving :" + e.getMessage()); + adolescentAndChildCareService.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); } - } catch (SQLException e) { - logger.error("Error in nurse data saving :" + e); - response.setError(5000, "Unable to save data : " + e.getLocalizedMessage()); - } catch (Exception e) { - logger.error("Error in nurse data saving :" + e); - response.setError(5000, "Unable to save data : " + e.getLocalizedMessage()); } return response.toString(); } @@ -113,8 +117,8 @@ public String saveDoctorDataCAC(@RequestBody String requestObj, } } catch (Exception e) { - logger.error("Error while saving doctor data:" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving doctor data:" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -424,8 +428,8 @@ public String updateCACDoctorData(@RequestBody String requestObj, logger.info("Doctor data update response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data. " + e.getLocalizedMessage()); - logger.error("Error while updating CAC doctor data:" + e); + logger.error("Unable to modify data. " + e.getLocalizedMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/anc/AntenatalCareController.java b/src/main/java/com/iemr/hwc/controller/anc/AntenatalCareController.java index a2455ca9..3b896d64 100644 --- a/src/main/java/com/iemr/hwc/controller/anc/AntenatalCareController.java +++ b/src/main/java/com/iemr/hwc/controller/anc/AntenatalCareController.java @@ -66,33 +66,38 @@ public class AntenatalCareController { * @Objective Save ANC data for nurse. * @param JSON requestObj * @return success or failure response + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save ANC nurse data", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenANCNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - - logger.info("Request object for ANC nurse data saving :" + requestObj); + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String ancRes = ancService.saveANCNurseData(jsnOBJ, Authorization); - response.setResponse(ancRes); - } else { - response.setError(5000, "Invalid request"); - } + try { - } catch (Exception e) { - logger.error("Error while saving nurse data:" + e); - response.setError(5000, "Unable to save data"); + logger.info("Request object for ANC nurse data saving :" + requestObj); + + if (jsnOBJ != null) { + String ancRes = ancService.saveANCNurseData(jsnOBJ, Authorization); + response.setResponse(ancRes); + } else { + response.setError(5000, "Invalid request"); + } + + } catch (Exception e) { + logger.error("Error while saving nurse data:" + e.getMessage()); + ancService.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); + } } return response.toString(); } @@ -127,8 +132,8 @@ public String saveBenANCDoctorData(@RequestBody String requestObj, } } catch (Exception e) { - logger.error("Error while saving doctor data:" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving doctor data:" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -564,8 +569,8 @@ public String updateANCDoctorData(@RequestBody String requestObj, } logger.info("ANC doctor data update Response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data. " + e.getMessage()); - logger.error("Error while updating beneficiary doctor data :" + e); + logger.error("Unable to modify data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/cancerscreening/CancerScreeningController.java b/src/main/java/com/iemr/hwc/controller/cancerscreening/CancerScreeningController.java index fb0380d3..b9d59197 100644 --- a/src/main/java/com/iemr/hwc/controller/cancerscreening/CancerScreeningController.java +++ b/src/main/java/com/iemr/hwc/controller/cancerscreening/CancerScreeningController.java @@ -67,31 +67,36 @@ public void setCancerScreeningServiceImpl(CSServiceImpl cSServiceImpl) { * @Objective Save Cancer Screening data for nurse. * @param JSON requestObj * @return success or failure response + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save cancer screening data collected by nurse", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenCancerScreeningNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for CS nurse data saving :" + requestObj); + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String nurseDataSaveSuccessFlag = cSServiceImpl.saveCancerScreeningNurseData(jsnOBJ, Authorization); - response.setResponse(nurseDataSaveSuccessFlag); - } else { - response.setError(5000, "Invalid request"); + try { + logger.info("Request object for CS nurse data saving :" + requestObj); + + if (jsnOBJ != null) { + String nurseDataSaveSuccessFlag = cSServiceImpl.saveCancerScreeningNurseData(jsnOBJ, Authorization); + response.setResponse(nurseDataSaveSuccessFlag); + } else { + response.setError(5000, "Invalid request"); + } + } catch (Exception e) { + logger.error("Error while saving beneficiary nurse data :" + e.getMessage()); + cSServiceImpl.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); } - } catch (Exception e) { - logger.error("Error while saving beneficiary nurse data :" + e); - response.setError(5000, "Unable to save data"); } return response.toString(); } @@ -128,8 +133,8 @@ public String saveBenCancerScreeningDoctorData(@RequestBody String requestObj, } } catch (Exception e) { - logger.error("Error while saving beneficiary doctor data :" + e); - response.setError(5000, "Unable to save data"); + logger.error("Error while saving beneficiary doctor data :" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -608,8 +613,8 @@ public String updateCancerScreeningDoctorData(@RequestBody String requestObj) { } logger.info("CS doctor data update Response:" + response); } catch (Exception e) { - response.setError(5000, "Error while updating beneficiary data. " + e); - logger.error("Error while updating beneficiary doctor data :" + e); + logger.error("Error while updating beneficiary data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } diff --git a/src/main/java/com/iemr/hwc/controller/covid19/CovidController.java b/src/main/java/com/iemr/hwc/controller/covid19/CovidController.java index 1a2cd164..e742bef1 100644 --- a/src/main/java/com/iemr/hwc/controller/covid19/CovidController.java +++ b/src/main/java/com/iemr/hwc/controller/covid19/CovidController.java @@ -62,26 +62,30 @@ public class CovidController { @ApiOperation(value = "Save COVID nurse data", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenNCDCareNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for COVID 19 nurse data saving :" + requestObj); + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String ncdCareRes = covid19ServiceImpl.saveCovid19NurseData(jsnOBJ, Authorization); - response.setResponse(ncdCareRes); - } else { - response.setError(5000, "Invalid Request !!!"); - } + try { + logger.info("Request object for COVID 19 nurse data saving :" + requestObj); - } catch (Exception e) { - logger.error("Error while saving Pandemic nurse data :" + e); - response.setError(5000, "Unable to save data"); + if (jsnOBJ != null) { + String ncdCareRes = covid19ServiceImpl.saveCovid19NurseData(jsnOBJ, Authorization); + response.setResponse(ncdCareRes); + } else { + response.setError(5000, "Invalid Request !!!"); + } + + } catch (Exception e) { + logger.error("Error while saving Pandemic nurse data :" + e.getMessage()); + covid19ServiceImpl.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); + } } return response.toString(); } @@ -117,8 +121,8 @@ public String saveBenCovidDoctorData(@RequestBody String requestObj, response.setResponse("Invalid request"); } } catch (Exception e) { - logger.error("Error while saving Covid doctor data :" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving Covid doctor data :" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -364,8 +368,8 @@ public String updateCovid19DoctorData(@RequestBody String requestObj, } logger.info("Doctor data update Response:" + response); } catch (Exception e) { - response.setError(500, "Unable to modify data. " + e.getMessage()); - logger.error("Error while updating doctor data :" + e); + logger.error("Unable to modify data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/familyPlanning/FamilyPlanningController.java b/src/main/java/com/iemr/hwc/controller/familyPlanning/FamilyPlanningController.java index 552fe2cf..3460ea84 100644 --- a/src/main/java/com/iemr/hwc/controller/familyPlanning/FamilyPlanningController.java +++ b/src/main/java/com/iemr/hwc/controller/familyPlanning/FamilyPlanningController.java @@ -121,26 +121,31 @@ public String saveFamilyPlanningNuseData(@ApiParam(value = "{\r\n" + " \"visitD + " \"parkingPlaceID\": 246,\r\n" + " \"vanID\": 220,\r\n" + " \"serviceID\": \"4\",\r\n" + " \"createdBy\": \"testtm\",\r\n" + " \"tcRequest\": null,\r\n" + " \"beneficiaryRegID\": \"274661\",\r\n" + " \"providerServiceMapID\": \"1261\"\r\n" + "}\r\n" - + "") @RequestBody String requestOBJ, @RequestHeader(value = "Authorization") String Authorization) { + + "") @RequestBody String requestOBJ, @RequestHeader(value = "Authorization") String Authorization) + throws Exception { OutputResponse response = new OutputResponse(); - try { + if (null != requestOBJ) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestOBJ); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { + try { - String outcome = familyPlanningService.saveNurseDataFP(jsnOBJ, Authorization); - // set response once data save successfully - response.setResponse(outcome); - } else - throw new IEMRException("Invalid request object / NULL"); - } catch (Exception e) { - logger.error("error in saving family-planning nurse data : " + e.getLocalizedMessage()); - response.setError(5000, "error in saving family-planning nurse data : " + e.getLocalizedMessage()); + if (jsnOBJ != null) { + + String outcome = familyPlanningService.saveNurseDataFP(jsnOBJ, Authorization); + // set response once data save successfully + response.setResponse(outcome); + } else + throw new IEMRException("Invalid request object / NULL"); + } catch (Exception e) { + logger.error("error in saving family-planning nurse data : " + e.getLocalizedMessage()); + familyPlanningService.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); + } } return response.toString(); @@ -169,8 +174,8 @@ public String saveFamilyPlanningDoctorData(@RequestBody String requestObj, } } catch (Exception e) { - logger.error("Error while saving doctor data:" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving doctor data:" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -388,8 +393,8 @@ public String updateFamilyPlanningDoctorData(@RequestBody String requestObj, logger.info("Doctor data update response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data. " + e.getLocalizedMessage()); - logger.error("Error while updating FamilyPlanning doctor data:" + e); + logger.error("Unable to modify data. " + e.getLocalizedMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/generalOPD/GeneralOPDController.java b/src/main/java/com/iemr/hwc/controller/generalOPD/GeneralOPDController.java index fc1ae298..52379d6a 100644 --- a/src/main/java/com/iemr/hwc/controller/generalOPD/GeneralOPDController.java +++ b/src/main/java/com/iemr/hwc/controller/generalOPD/GeneralOPDController.java @@ -65,21 +65,25 @@ public void setGeneralOPDServiceImpl(GeneralOPDServiceImpl generalOPDServiceImpl * @Objective Save General OPD data for nurse. * @param requestObj * @return success or failure response + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save general OPD data collected by nurse", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenGenOPDNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for GeneralOPD nurse data saving :" + requestObj); - + + if(null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); + + try { + logger.info("Request object for GeneralOPD nurse data saving :" + requestObj); + if (jsnOBJ != null) { String genOPDRes = generalOPDServiceImpl.saveNurseData(jsnOBJ, Authorization); response.setResponse(genOPDRes); @@ -87,8 +91,10 @@ public String saveBenGenOPDNurseData(@RequestBody String requestObj, response.setResponse("Invalid request"); } } catch (Exception e) { - logger.error("Error in nurse data saving :" + e); - response.setError(5000, "Unable to save data"); + logger.error("Error in nurse data saving :" + e.getMessage()); + generalOPDServiceImpl.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); + } } return response.toString(); } @@ -124,8 +130,8 @@ public String saveBenGenOPDDoctorData(@RequestBody String requestObj, response.setResponse("Invalid request"); } } catch (Exception e) { - logger.error("Error in doctor data saving :" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error in doctor data saving :" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -437,8 +443,8 @@ public String updateGeneralOPDDoctorData(@RequestBody String requestObj, } logger.info("Doctor data update response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data. " + e.getMessage()); - logger.error("Error while updating General OPD doctor data:" + e); + logger.error("Unable to modify data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/ncdCare/NCDCareController.java b/src/main/java/com/iemr/hwc/controller/ncdCare/NCDCareController.java index 17b719c1..8a8a618f 100644 --- a/src/main/java/com/iemr/hwc/controller/ncdCare/NCDCareController.java +++ b/src/main/java/com/iemr/hwc/controller/ncdCare/NCDCareController.java @@ -55,42 +55,42 @@ public class NCDCareController { private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); - private NCDCareServiceImpl ncdCareServiceImpl; - @Autowired - public void setNcdCareServiceImpl(NCDCareServiceImpl ncdCareServiceImpl) { - this.ncdCareServiceImpl = ncdCareServiceImpl; - } + private NCDCareServiceImpl ncdCareServiceImpl; /** * @Objective Save NCD Care data for nurse. * @param JSON requestObj * @return success or failure response + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save NCD care data collected by nurse", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenNCDCareNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for NCD Care nurse data saving :" + requestObj); - + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String ncdCareRes = ncdCareServiceImpl.saveNCDCareNurseData(jsnOBJ, Authorization); - response.setResponse(ncdCareRes); - } else { - response.setError(5000, "Invalid Request !!!"); - } + try { + logger.info("Request object for NCD Care nurse data saving :" + requestObj); - } catch (Exception e) { - logger.error("Error while saving NCD Care nurse data :" + e); - response.setError(5000, "Unable to save data"); + if (jsnOBJ != null) { + String ncdCareRes = ncdCareServiceImpl.saveNCDCareNurseData(jsnOBJ, Authorization); + response.setResponse(ncdCareRes); + } else { + response.setError(5000, "Invalid Request !!!"); + } + + } catch (Exception e) { + logger.error("Error while saving NCD Care nurse data :" + e.getMessage()); + ncdCareServiceImpl.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); + } } return response.toString(); } @@ -126,8 +126,8 @@ public String saveBenNCDCareDoctorData(@RequestBody String requestObj, response.setResponse("Invalid request"); } } catch (Exception e) { - logger.error("Error while saving NCD Care doctor data :" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving NCD Care doctor data :" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -373,8 +373,8 @@ public String updateNCDCareDoctorData(@RequestBody String requestObj, } logger.info("Doctor data update Response:" + response); } catch (Exception e) { - response.setError(500, "Unable to modify data. " + e.getMessage()); - logger.error("Error while updating doctor data :" + e); + logger.error("Unable to modify data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/ncdscreening/NCDScreeningController.java b/src/main/java/com/iemr/hwc/controller/ncdscreening/NCDScreeningController.java index f470f1b7..c211015d 100644 --- a/src/main/java/com/iemr/hwc/controller/ncdscreening/NCDScreeningController.java +++ b/src/main/java/com/iemr/hwc/controller/ncdscreening/NCDScreeningController.java @@ -59,45 +59,48 @@ public class NCDScreeningController { @Autowired private NCDScreeningService ncdScreeningService; - + @Autowired private NCDSCreeningDoctorService ncdSCreeningDoctorService; /** * @Objective Save NCD Screening data for nurse. - * @param JSON requestObj + * @param JSON requestObj * @return success or failure response + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save NCD screening beneficiary data collected by nurse", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBeneficiaryNCDScreeningDetails(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { logger.info("Request object for NCD Screening nurse data saving :" + requestObj); OutputResponse response = new OutputResponse(); - JsonObject jsonObject = new JsonObject(); - JsonParser jsonParser = new JsonParser(); - - try { - JsonElement jsonElement = jsonParser.parse(requestObj); - jsonObject = jsonElement.getAsJsonObject(); + if (null != requestObj) { + JsonObject jsonObject = new JsonObject(); + JsonParser jsnParser = new JsonParser(); + JsonElement jsnElmnt = jsnParser.parse(requestObj); + jsonObject = jsnElmnt.getAsJsonObject(); - if (jsonObject != null) { - String r = ncdScreeningService.saveNCDScreeningNurseData(jsonObject,Authorization); - response.setResponse(r); - } else { - response.setError(5000, "Invalid request"); + try { + if (jsonObject != null) { + String r = ncdScreeningService.saveNCDScreeningNurseData(jsonObject, Authorization); + response.setResponse(r); + } else { + response.setError(5000, "Invalid request"); + } + } catch (Exception e) { + logger.error("Error in nurse data saving :" + e.getMessage()); + ncdScreeningService.deleteVisitDetails(jsonObject); + response.setError(5000, e.getMessage()); } - } catch (Exception e) { - response.setError(5000, "Unable to save data"); - logger.error("Error while storing NCD Screening nurse data: " + e); } return response.toString(); } - + @CrossOrigin @ApiOperation(value = "Save NCD screening beneficiary data collected by doctor", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/doctorData" }, method = { RequestMethod.POST }) @@ -124,11 +127,12 @@ public String saveBenNCDScreeningDoctorData(@RequestBody String requestObj, response.setResponse("Invalid request"); } } catch (Exception e) { - logger.error("Error while saving NCD Screening doctor data :" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving NCD Screening doctor data :" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } + /** * @Objective Fetching NCD Screening nurse data. * @param benRegID and benVisitID @@ -392,6 +396,7 @@ public String getCbacDetails( } return response.toStringWithSerializeNulls(); } + /** * * @param requestObj @@ -543,8 +548,8 @@ public String updateDoctorData(@RequestBody String requestObj, else response.setError(5000, "Error in data update"); } catch (Exception e) { - response.setError(5000, "Unable to modify data : " + e.getLocalizedMessage()); - logger.error("Error while updating doctor data : " + e); + logger.error("Unable to modify data : " + e.getLocalizedMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/neonatal/NeonatalController.java b/src/main/java/com/iemr/hwc/controller/neonatal/NeonatalController.java index f73b671c..f249239f 100644 --- a/src/main/java/com/iemr/hwc/controller/neonatal/NeonatalController.java +++ b/src/main/java/com/iemr/hwc/controller/neonatal/NeonatalController.java @@ -60,34 +60,39 @@ public class NeonatalController { * @Objective Save neonatal infant data for nurse. * @param requestObj * @return success or failure response with visit code + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save neonatal infant nurse data", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenNeoNatalAndInfantNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for neonatal infant nurse data saving :" + requestObj); + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String genOPDRes = neonatalService.saveNurseData(jsnOBJ, Authorization); - response.setResponse(genOPDRes); - - } else { - response.setResponse("Invalid request"); + try { + logger.info("Request object for neonatal infant nurse data saving :" + requestObj); + + if (jsnOBJ != null) { + String genOPDRes = neonatalService.saveNurseData(jsnOBJ, Authorization); + response.setResponse(genOPDRes); + + } else { + response.setResponse("Invalid request"); + } + } catch (SQLException e) { + logger.error("Error in nurse data saving :" + e); + response.setError(5000, "Unable to save data : " + e.getLocalizedMessage()); + } catch (Exception e) { + logger.error("Error in nurse data saving :" + e.getMessage()); + neonatalService.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); } - } catch (SQLException e) { - logger.error("Error in nurse data saving :" + e); - response.setError(5000, "Unable to save data : " + e.getLocalizedMessage()); - } catch (Exception e) { - logger.error("Error in nurse data saving :" + e); - response.setError(5000, "Unable to save data : " + e.getLocalizedMessage()); } return response.toString(); } @@ -115,8 +120,8 @@ public String saveNNIDoctorData(@RequestBody String requestObj, } } catch (Exception e) { - logger.error("Error while saving doctor data:" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving doctor data:" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -398,8 +403,8 @@ public String updateNNIDoctorData(@RequestBody String requestObj, logger.info("Doctor data update response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data. " + e.getLocalizedMessage()); - logger.error("Error while updating neonatal infant doctor data:" + e); + logger.error("Unable to modify data. " + e.getLocalizedMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/pnc/PostnatalCareController.java b/src/main/java/com/iemr/hwc/controller/pnc/PostnatalCareController.java index 650a4620..9c80d27c 100644 --- a/src/main/java/com/iemr/hwc/controller/pnc/PostnatalCareController.java +++ b/src/main/java/com/iemr/hwc/controller/pnc/PostnatalCareController.java @@ -63,32 +63,37 @@ public void setPncServiceImpl(PNCServiceImpl pncServiceImpl) { * @Objective Saving PNC nurse data * @param requestObj * @return success or failure response + * @throws Exception */ @CrossOrigin @ApiOperation(value = "Save PNC nurse data", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenPNCNurseData(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - try { - logger.info("Request object for PNC nurse data saving :" + requestObj); + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String ancRes = pncServiceImpl.savePNCNurseData(jsnOBJ, Authorization); - response.setResponse(ancRes); - } else { - response.setError(5000, "Invalid request"); - } + try { + logger.info("Request object for PNC nurse data saving :" + requestObj); - } catch (Exception e) { - logger.error("Error while saving nurse data :" + e); - response.setError(5000, "Unable to save data"); + if (jsnOBJ != null) { + String ancRes = pncServiceImpl.savePNCNurseData(jsnOBJ, Authorization); + response.setResponse(ancRes); + } else { + response.setError(5000, "Invalid request"); + } + + } catch (Exception e) { + logger.error("Error while saving nurse data :" + e.getMessage()); + pncServiceImpl.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); + } } return response.toString(); } @@ -124,8 +129,8 @@ public String saveBenPNCDoctorData(@RequestBody String requestObj, } } catch (Exception e) { - logger.error("Error while saving doctor data :" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving doctor data :" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); } @@ -505,8 +510,8 @@ public String updatePNCDoctorData(@RequestBody String requestObj, } logger.info("Doctor data update response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data. " + e.getMessage()); - logger.error("Error while updating doctor data :" + e); + logger.error("Unable to modify data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/controller/quickconsult/QuickConsultController.java b/src/main/java/com/iemr/hwc/controller/quickconsult/QuickConsultController.java index 6fb93c2d..aa9430bc 100644 --- a/src/main/java/com/iemr/hwc/controller/quickconsult/QuickConsultController.java +++ b/src/main/java/com/iemr/hwc/controller/quickconsult/QuickConsultController.java @@ -65,6 +65,7 @@ public void setQuickConsultationServiceImpl(QuickConsultationServiceImpl quickCo * * @param requestObj * @return success or failure response + * @throws Exception * @objective first data will be pushed to BenVisitDetails Table and benVisitID * will be generated and then this benVisitID will be patched with * Beneficiary Vital and Anthropometry Detail Object and pushed to @@ -74,24 +75,28 @@ public void setQuickConsultationServiceImpl(QuickConsultationServiceImpl quickCo @ApiOperation(value = "Save quick consult nurse data", consumes = "application/json", produces = "application/json") @RequestMapping(value = { "/save/nurseData" }, method = { RequestMethod.POST }) public String saveBenQuickConsultDataNurse(@RequestBody String requestObj, - @RequestHeader(value = "Authorization") String Authorization) { + @RequestHeader(value = "Authorization") String Authorization) throws Exception { OutputResponse response = new OutputResponse(); - logger.info("Quick consult nurse data save request : " + requestObj); - try { + + if (null != requestObj) { JsonObject jsnOBJ = new JsonObject(); JsonParser jsnParser = new JsonParser(); JsonElement jsnElmnt = jsnParser.parse(requestObj); jsnOBJ = jsnElmnt.getAsJsonObject(); - if (jsnOBJ != null) { - String r = quickConsultationServiceImpl.quickConsultNurseDataInsert(jsnOBJ, Authorization); - response.setResponse(r); - } else { - response.setError(5000, "Invalid request"); + logger.info("Quick consult nurse data save request : " + requestObj); + try { + if (jsnOBJ != null) { + String r = quickConsultationServiceImpl.quickConsultNurseDataInsert(jsnOBJ, Authorization); + response.setResponse(r); + } else { + response.setError(5000, "Invalid request"); + } + } catch (Exception e) { + logger.error("Error while saving quick consult nurse data: " + e.getMessage()); + quickConsultationServiceImpl.deleteVisitDetails(jsnOBJ); + response.setError(5000, e.getMessage()); } - } catch (Exception e) { - logger.error("Error while saving quick consult nurse data: " + e); - response.setError(5000, "Unable to save data"); } return response.toString(); } @@ -135,8 +140,8 @@ public String saveQuickConsultationDetail( } logger.info("Quick consult doctor data save response:" + response); } catch (Exception e) { - logger.error("Error while saving quick consult doctor data:" + e); - response.setError(5000, "Unable to save data. " + e.getMessage()); + logger.error("Error while saving quick consult doctor data:" + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); @@ -281,8 +286,8 @@ public String updateGeneralOPDQCDoctorData(@RequestBody String requestObj, } logger.info("Quick consult doctor data update response:" + response); } catch (Exception e) { - response.setError(5000, "Unable to modify data"); - logger.error("Error while updating quick consult doctor data :" + e); + logger.error("Unable to modify data. " + e.getMessage()); + response.setError(5000, e.getMessage()); } return response.toString(); diff --git a/src/main/java/com/iemr/hwc/repo/adolescent/OralVitaminNoOfDoseMasterRepo.java b/src/main/java/com/iemr/hwc/repo/adolescent/OralVitaminNoOfDoseMasterRepo.java index 0393a99b..79d2aee7 100644 --- a/src/main/java/com/iemr/hwc/repo/adolescent/OralVitaminNoOfDoseMasterRepo.java +++ b/src/main/java/com/iemr/hwc/repo/adolescent/OralVitaminNoOfDoseMasterRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.adolescent.OralVitaminNoOfDoseMaster; @Repository +@RestResource(exported = false) public interface OralVitaminNoOfDoseMasterRepo extends CrudRepository { List findByDeleted(Boolean deleted); diff --git a/src/main/java/com/iemr/hwc/repo/adolescent/T_OralVitaminProphylaxisRepo.java b/src/main/java/com/iemr/hwc/repo/adolescent/T_OralVitaminProphylaxisRepo.java index 3439976d..7dbe0e9c 100644 --- a/src/main/java/com/iemr/hwc/repo/adolescent/T_OralVitaminProphylaxisRepo.java +++ b/src/main/java/com/iemr/hwc/repo/adolescent/T_OralVitaminProphylaxisRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.adolescent.T_OralVitaminProphylaxis; @Repository +@RestResource(exported = false) public interface T_OralVitaminProphylaxisRepo extends CrudRepository { List findByBeneficiaryRegIDAndVisitCodeAndDeleted(Long regId, Long visitCode, diff --git a/src/main/java/com/iemr/hwc/repo/family_planning/FPDispenseDetailsRepo.java b/src/main/java/com/iemr/hwc/repo/family_planning/FPDispenseDetailsRepo.java index 5fd142ed..cc1a4b0d 100644 --- a/src/main/java/com/iemr/hwc/repo/family_planning/FPDispenseDetailsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/family_planning/FPDispenseDetailsRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.family_planning.FPDispenseDetails; @Repository +@RestResource(exported = false) public interface FPDispenseDetailsRepo extends CrudRepository { public FPDispenseDetails findOneByBeneficiaryRegIDAndVisitCode(Long regId, Long visitCode); diff --git a/src/main/java/com/iemr/hwc/repo/family_planning/FPIecCounsellingDetailsRepo.java b/src/main/java/com/iemr/hwc/repo/family_planning/FPIecCounsellingDetailsRepo.java index 1a1839a8..b84f6c0b 100644 --- a/src/main/java/com/iemr/hwc/repo/family_planning/FPIecCounsellingDetailsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/family_planning/FPIecCounsellingDetailsRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.family_planning.FPIecCounsellingDetails; @Repository +@RestResource(exported = false) public interface FPIecCounsellingDetailsRepo extends CrudRepository { public FPIecCounsellingDetails findOneByBeneficiaryRegIDAndVisitCode(Long regId, Long visitCode); diff --git a/src/main/java/com/iemr/hwc/repo/family_planning/FamilyPlanningReproductiveRepo.java b/src/main/java/com/iemr/hwc/repo/family_planning/FamilyPlanningReproductiveRepo.java index 6307d2e9..37aefe2f 100644 --- a/src/main/java/com/iemr/hwc/repo/family_planning/FamilyPlanningReproductiveRepo.java +++ b/src/main/java/com/iemr/hwc/repo/family_planning/FamilyPlanningReproductiveRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.family_planning.FamilyPlanningReproductive; @Repository +@RestResource(exported = false) public interface FamilyPlanningReproductiveRepo extends CrudRepository { public FamilyPlanningReproductive findOneByBeneficiaryRegIDAndVisitCode(Long regId, Long visitCode); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/RelationshipMasterRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/RelationshipMasterRepo.java index 0e8b8050..fb074894 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/RelationshipMasterRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/RelationshipMasterRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.registrar.RelationshipMaster; - +@Repository +@RestResource(exported = false) public interface RelationshipMasterRepo extends CrudRepository { @Query("select r from RelationshipMaster r where r.deleted is false") diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/BloodGlucoseMasterRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/BloodGlucoseMasterRepo.java index e1856496..fcabe13e 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/BloodGlucoseMasterRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/BloodGlucoseMasterRepo.java @@ -25,10 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.BloodGlucoseType; @Repository +@RestResource(exported = false) public interface BloodGlucoseMasterRepo extends CrudRepository { @Query("select b from BloodGlucoseType b where b.deleted = false") diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CBACRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CBACRepo.java index 8e121717..202bb2c0 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CBACRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CBACRepo.java @@ -26,10 +26,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.CBAC; @Repository +@RestResource(exported = false) public interface CBACRepo extends CrudRepository { @Query("select c from CBAC c where c.deleted = false AND (c.gender =:gender OR c.gender is null) order by questionId") diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CervicalLympRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CervicalLympRepo.java index 8c6cfebf..dfa459fc 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CervicalLympRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/CervicalLympRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.CervicalLymph; - +@Repository +@RestResource(exported = false) public interface CervicalLympRepo extends CrudRepository { @Query("SELECT obj FROM CervicalLymph obj WHERE obj.deleted is false") diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/InpectionBreastsRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/InpectionBreastsRepo.java index 11b1bdea..b74cf35b 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/InpectionBreastsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/InpectionBreastsRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.InpectionofBreasts; - +@Repository +@RestResource(exported = false) public interface InpectionBreastsRepo extends CrudRepository { @Query("SELECT obj FROM InpectionofBreasts obj WHERE obj.deleted is false") ArrayList getBreastInspectionMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/MouthOpeningRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/MouthOpeningRepo.java index 734203b8..d4a6f0ce 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/MouthOpeningRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/MouthOpeningRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.MouthOpening; - +@Repository +@RestResource(exported = false) public interface MouthOpeningRepo extends CrudRepository { @Query("SELECT obj FROM MouthOpening obj WHERE obj.deleted is false") diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/OralCavityFindingRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/OralCavityFindingRepo.java index 6f6de80b..ef3d46e8 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/OralCavityFindingRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/OralCavityFindingRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.OralCavityFinding; - +@Repository +@RestResource(exported = false) public interface OralCavityFindingRepo extends CrudRepository { @Query("SELECT obj FROM OralCavityFinding obj WHERE obj.deleted is false") ArrayList getOralCavityMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationBreastsRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationBreastsRepo.java index e94adcda..8580ffe8 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationBreastsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationBreastsRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.PalpationOfBreasts; - +@Repository +@RestResource(exported = false) public interface PalpationBreastsRepo extends CrudRepository { @Query("SELECT obj FROM PalpationOfBreasts obj WHERE obj.deleted is false") ArrayList getPalpationBreastsMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOfLymphRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOfLymphRepo.java index 996a80b2..2ea3b593 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOfLymphRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOfLymphRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.PalpationOfLymph; - +@Repository +@RestResource(exported = false) public interface PalpationOfLymphRepo extends CrudRepository { @Query("SELECT obj FROM PalpationOfLymph obj WHERE obj.deleted is false") ArrayList getPalpationLymphMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOralCavityRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOralCavityRepo.java index b4ff43a5..e4a29d4a 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOralCavityRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/PalpationOralCavityRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.PalpationOfOralCavity; - +@Repository +@RestResource(exported = false) public interface PalpationOralCavityRepo extends CrudRepository { @Query("SELECT obj FROM PalpationOfOralCavity obj WHERE obj.deleted is false") ArrayList getPalpationOralCavityMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/TemperomandibularRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/TemperomandibularRepo.java index 7b64b23a..5a7bbdd9 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/TemperomandibularRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/TemperomandibularRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.TemperomandibularJoin; - +@Repository +@RestResource(exported = false) public interface TemperomandibularRepo extends CrudRepository { @Query("SELECT obj FROM TemperomandibularJoin obj WHERE obj.deleted is false") ArrayList getTemperomandibularJoinMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/VisualExamRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/VisualExamRepo.java index 9f1e6f49..1694de73 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/VisualExamRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/ncdScreening/VisualExamRepo.java @@ -25,9 +25,12 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; +import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.ncdscreening.VisualExamination; - +@Repository +@RestResource(exported = false) public interface VisualExamRepo extends CrudRepository { @Query("SELECT obj FROM VisualExamination obj WHERE obj.deleted is false") ArrayList getVisualExaminationMasters(); diff --git a/src/main/java/com/iemr/hwc/repo/masterrepo/pnc/DeliveryConductedByMasterRepo.java b/src/main/java/com/iemr/hwc/repo/masterrepo/pnc/DeliveryConductedByMasterRepo.java index 75b2c936..97b8db94 100644 --- a/src/main/java/com/iemr/hwc/repo/masterrepo/pnc/DeliveryConductedByMasterRepo.java +++ b/src/main/java/com/iemr/hwc/repo/masterrepo/pnc/DeliveryConductedByMasterRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.masterdata.pnc.DeliveryConductedByMaster; @Repository +@RestResource(exported = false) public interface DeliveryConductedByMasterRepo extends CrudRepository { List findByDeleted(Boolean deleted); diff --git a/src/main/java/com/iemr/hwc/repo/neonatal/FollowUpForImmunizationRepo.java b/src/main/java/com/iemr/hwc/repo/neonatal/FollowUpForImmunizationRepo.java index 44e77de4..bef0467f 100644 --- a/src/main/java/com/iemr/hwc/repo/neonatal/FollowUpForImmunizationRepo.java +++ b/src/main/java/com/iemr/hwc/repo/neonatal/FollowUpForImmunizationRepo.java @@ -22,11 +22,13 @@ package com.iemr.hwc.repo.neonatal; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.neonatal.FollowUpForImmunization; @Repository +@RestResource(exported = false) public interface FollowUpForImmunizationRepo extends CrudRepository { FollowUpForImmunization findByBeneficiaryRegIDAndVisitCode(long benRegId, long visitCode); diff --git a/src/main/java/com/iemr/hwc/repo/neonatal/ImmunizationServicesRepo.java b/src/main/java/com/iemr/hwc/repo/neonatal/ImmunizationServicesRepo.java index 56d0af6c..660f8287 100644 --- a/src/main/java/com/iemr/hwc/repo/neonatal/ImmunizationServicesRepo.java +++ b/src/main/java/com/iemr/hwc/repo/neonatal/ImmunizationServicesRepo.java @@ -27,12 +27,14 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import com.iemr.hwc.data.neonatal.ImmunizationServices; @Repository +@RestResource(exported = false) public interface ImmunizationServicesRepo extends CrudRepository { List findByBeneficiaryRegIDAndVisitCodeAndDeleted(long benRegId, long visitCode, boolean deleted); diff --git a/src/main/java/com/iemr/hwc/repo/neonatal/InfantBirthDetailsRepo.java b/src/main/java/com/iemr/hwc/repo/neonatal/InfantBirthDetailsRepo.java index 51bcc0c5..7660d1ee 100644 --- a/src/main/java/com/iemr/hwc/repo/neonatal/InfantBirthDetailsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/neonatal/InfantBirthDetailsRepo.java @@ -22,11 +22,13 @@ package com.iemr.hwc.repo.neonatal; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.neonatal.InfantBirthDetails; @Repository +@RestResource(exported = false) public interface InfantBirthDetailsRepo extends CrudRepository { InfantBirthDetails findByBeneficiaryRegIDAndVisitCode(Long benRegId, Long visitCode); diff --git a/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java index 2cb78bbd..14b0da09 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/BenVisitDetailRepo.java @@ -120,4 +120,13 @@ public int updateFileID(@Param("fileIDs") String fileIDs, @Param("regID") Long r @Query(" SELECT bvd from BeneficiaryVisitDetail bvd WHERE bvd.benVisitID = :benVisitID AND bvd.lastModDate > :lastModDate ORDER BY bvd.lastModDate DESC") public BeneficiaryVisitDetail getVisitDetailsByVisitIDAndLastModifDate(@Param("benVisitID") Long benVisitID, @Param("lastModDate") Timestamp lastModDate); + @Query(nativeQuery = true, value = " SELECT v.visitCode FROM t_benvisitdetail v WHERE v.beneficiaryRegID=:benRegId AND v.providerServiceMapID=:psmId ORDER BY BenVisitID DESC LIMIT 1 ") + public Long getVisitCode(@Param("benRegId") Long benRegId, @Param("psmId") Integer psmId); + + @Modifying + @Transactional + @Query(" DELETE FROM BeneficiaryVisitDetail WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); + + } diff --git a/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java index ba0597cb..9d9e4d9f 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/CDSSRepo.java @@ -1,16 +1,26 @@ package com.iemr.hwc.repo.nurse; +import javax.transaction.Transactional; + +import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.nurse.CDSS; @Repository +@RestResource(exported = false) public interface CDSSRepo extends CrudRepository { CDSS findByBeneficiaryRegIDAndVisitCode(Long beneficiaryRegID, Long visitCode); + @Modifying + @Transactional + @Query("DELETE FROM CDSS WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); + } diff --git a/src/main/java/com/iemr/hwc/repo/nurse/anc/BenAdherenceRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/anc/BenAdherenceRepo.java index 6a24b524..546f9211 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/anc/BenAdherenceRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/anc/BenAdherenceRepo.java @@ -63,4 +63,9 @@ public int updateBenAdherence(@Param("toDrugs") Boolean toDrugs, @Param("benVisitID") Long benVisitID, @Param("ID") Long ID); + @Modifying + @Transactional + @Query("DELETE FROM BenAdherence WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); + } diff --git a/src/main/java/com/iemr/hwc/repo/nurse/covid19/Covid19BenFeedbackRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/covid19/Covid19BenFeedbackRepo.java index 0e87f577..c47307d0 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/covid19/Covid19BenFeedbackRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/covid19/Covid19BenFeedbackRepo.java @@ -21,9 +21,13 @@ */ package com.iemr.hwc.repo.nurse.covid19; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; import com.iemr.hwc.data.covid19.Covid19BenFeedback; @@ -31,4 +35,9 @@ @RestResource(exported = false) public interface Covid19BenFeedbackRepo extends CrudRepository { Covid19BenFeedback findByBeneficiaryRegIDAndVisitCode(Long benRegID, Long visitCode); + + @Modifying + @Transactional + @Query(" DELETE FROM Covid19BenFeedback WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); } diff --git a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/BreastCancerScreeningRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/BreastCancerScreeningRepo.java index 4094301b..859df1bd 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/BreastCancerScreeningRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/BreastCancerScreeningRepo.java @@ -27,11 +27,13 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.ncdScreening.BreastCancerScreening; @Repository +@RestResource(exported = false) public interface BreastCancerScreeningRepo extends CrudRepository { // @Query("SELECT db FROM BreastCancerScreening db WHERE db.beneficiaryRegID = :beneficiaryRegID AND db.beneficiaryVisitId = :beneficiaryVisitId ") diff --git a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CbacDetailsRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CbacDetailsRepo.java index e36b87e0..808824df 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CbacDetailsRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CbacDetailsRepo.java @@ -22,11 +22,13 @@ package com.iemr.hwc.repo.nurse.ncdscreening; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.ncdScreening.CbacDetails; @Repository +@RestResource(exported = false) public interface CbacDetailsRepo extends CrudRepository { public CbacDetails findByBeneficiaryRegIdAndVisitCode(Long beneficiaryRegId, Long visitCode); diff --git a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CervicalCancerScreeningRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CervicalCancerScreeningRepo.java index 7e6e56f1..4867d70c 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CervicalCancerScreeningRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/CervicalCancerScreeningRepo.java @@ -27,11 +27,13 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.ncdScreening.CervicalCancerScreening; @Repository +@RestResource(exported = false) public interface CervicalCancerScreeningRepo extends CrudRepository { // @Query("SELECT db FROM CervicalCancerScreening db WHERE db.beneficiaryRegID = :beneficiaryRegID AND db.beneficiaryVisitId = :beneficiaryVisitId ") diff --git a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/DiabetesScreeningRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/DiabetesScreeningRepo.java index 27ad7bf4..8de54378 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/DiabetesScreeningRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/DiabetesScreeningRepo.java @@ -27,6 +27,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.ncdScreening.DiabetesScreening; @@ -37,6 +38,7 @@ */ @Repository +@RestResource(exported = false) public interface DiabetesScreeningRepo extends CrudRepository { // // @Query("SELECT obj FROM Diabetes obj WHERE obj.beneficiaryRegId = :beneficiaryRegId AND " diff --git a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/HypertensionScreeningRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/HypertensionScreeningRepo.java index 9ec58430..7ce54aa0 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/HypertensionScreeningRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/HypertensionScreeningRepo.java @@ -29,6 +29,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.ncdScreening.HypertensionScreening; @@ -39,6 +40,7 @@ */ @Repository +@RestResource(exported = false) public interface HypertensionScreeningRepo extends CrudRepository { // @Query("SELECT obj FROM Hypertension obj WHERE obj.beneficiaryRegId = :beneficiaryRegId AND " // + "obj.beneficiaryVisitId = :beneficiaryVisitId") diff --git a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/OralCancerScreeningRepo.java b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/OralCancerScreeningRepo.java index 1839f72d..d36b2c1d 100644 --- a/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/OralCancerScreeningRepo.java +++ b/src/main/java/com/iemr/hwc/repo/nurse/ncdscreening/OralCancerScreeningRepo.java @@ -27,11 +27,13 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.ncdScreening.OralCancerScreening; @Repository +@RestResource(exported = false) public interface OralCancerScreeningRepo extends CrudRepository { // @Query("SELECT db FROM OralCancerScreening db WHERE db.beneficiaryRegID = :beneficiaryRegID AND db.beneficiaryVisitId = :beneficiaryVisitId ") diff --git a/src/main/java/com/iemr/hwc/repo/quickConsultation/BenChiefComplaintRepo.java b/src/main/java/com/iemr/hwc/repo/quickConsultation/BenChiefComplaintRepo.java index 463747ac..3e6ab6c0 100644 --- a/src/main/java/com/iemr/hwc/repo/quickConsultation/BenChiefComplaintRepo.java +++ b/src/main/java/com/iemr/hwc/repo/quickConsultation/BenChiefComplaintRepo.java @@ -49,5 +49,10 @@ public ArrayList getBenChiefComplaints(@Param("benRegID") Long benRegI @Transactional @Query(" Delete from BenChiefComplaint WHERE beneficiaryRegID = :benRegID AND visitCode = :visitCode") public int deleteExistingBenChiefComplaints(@Param("benRegID") Long benRegID, @Param("visitCode") Long visitCode); + + @Modifying + @Transactional + @Query("DELETE FROM BenChiefComplaint WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); } diff --git a/src/main/java/com/iemr/hwc/repo/quickConsultation/LabTestOrderDetailRepo.java b/src/main/java/com/iemr/hwc/repo/quickConsultation/LabTestOrderDetailRepo.java index 0beb5bdb..5ab7371b 100644 --- a/src/main/java/com/iemr/hwc/repo/quickConsultation/LabTestOrderDetailRepo.java +++ b/src/main/java/com/iemr/hwc/repo/quickConsultation/LabTestOrderDetailRepo.java @@ -52,4 +52,9 @@ public ArrayList getLabTestOrderDetails2(@Param("benRegID") @Query(" Delete from LabTestOrderDetail WHERE beneficiaryRegID = :benRegID AND benVisitID = :benVisitID ") public int deleteExistingLabTestOrderDetail(@Param("benRegID") Long benRegID, @Param("benVisitID") Long benVisitID); + @Modifying + @Transactional + @Query(" DELETE FROM LabTestOrderDetail WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); + } diff --git a/src/main/java/com/iemr/hwc/repo/quickConsultation/PrescriptionDetailRepo.java b/src/main/java/com/iemr/hwc/repo/quickConsultation/PrescriptionDetailRepo.java index 6194e283..ce217c10 100644 --- a/src/main/java/com/iemr/hwc/repo/quickConsultation/PrescriptionDetailRepo.java +++ b/src/main/java/com/iemr/hwc/repo/quickConsultation/PrescriptionDetailRepo.java @@ -89,5 +89,10 @@ public int updatePrescription(@Param("diagnosisProvided") String diagnosisProvid public List getProvisionalDiagnosis(@Param("visitCode") Long visitCode, @Param("prescriptionID") Long prescriptionID); + + @Modifying + @Transactional + @Query(" DELETE FROM PrescriptionDetail WHERE visitCode=:visitCode ") + public int deleteVisitDetails(@Param("visitCode") Long visitCode); } diff --git a/src/main/java/com/iemr/hwc/repo/uptsu/M_104ActionMasterRepo.java b/src/main/java/com/iemr/hwc/repo/uptsu/M_104ActionMasterRepo.java index 024b8226..e536eb86 100644 --- a/src/main/java/com/iemr/hwc/repo/uptsu/M_104ActionMasterRepo.java +++ b/src/main/java/com/iemr/hwc/repo/uptsu/M_104ActionMasterRepo.java @@ -24,11 +24,13 @@ import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; import com.iemr.hwc.data.uptsu.M_104ActionMaster; @Repository +@RestResource(exported = false) public interface M_104ActionMasterRepo extends CrudRepository { List findByDeleted(Boolean deleted); diff --git a/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareService.java b/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareService.java index 90098ddf..7b67b8bd 100644 --- a/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareService.java +++ b/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareService.java @@ -30,6 +30,8 @@ public interface AdolescentAndChildCareService { public String saveNurseData(JsonObject requestOBJ, String Authorization) throws SQLException, Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; public String getBenVisitDetailsFrmNurseCAC(Long benRegID, Long visitCode) throws Exception; diff --git a/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java b/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java index 1fccbc94..8b051a1c 100644 --- a/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/adolescent/AdolescentAndChildCareServiceImpl.java @@ -60,6 +60,9 @@ import com.iemr.hwc.repo.neonatal.ImmunizationServicesRepo; import com.iemr.hwc.repo.neonatal.InfantBirthDetailsRepo; import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -96,9 +99,15 @@ public class AdolescentAndChildCareServiceImpl implements AdolescentAndChildCare private LabTechnicianServiceImpl labTechnicianServiceImpl; @Autowired private T_OralVitaminProphylaxisRepo oralVitaminProphylaxisRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Override - @Transactional(rollbackFor = Exception.class) public String saveNurseData(JsonObject requestOBJ, String Authorization) throws SQLException, Exception { Map responseMap = new HashMap(); @@ -233,6 +242,26 @@ public String saveNurseData(JsonObject requestOBJ, String Authorization) throws return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } private Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonUtilityClass nurseUtilityClass) throws Exception { diff --git a/src/main/java/com/iemr/hwc/service/anc/ANCService.java b/src/main/java/com/iemr/hwc/service/anc/ANCService.java index b26e8185..7cf16ed6 100644 --- a/src/main/java/com/iemr/hwc/service/anc/ANCService.java +++ b/src/main/java/com/iemr/hwc/service/anc/ANCService.java @@ -29,6 +29,8 @@ public interface ANCService { public String saveANCNurseData(JsonObject requestOBJ, String Authorization) throws Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; // int UpdateANCVisitDetails(JsonObject jsnOBJ) throws Exception; diff --git a/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java b/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java index 903efbe4..cdb5801f 100644 --- a/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/anc/ANCServiceImpl.java @@ -81,13 +81,17 @@ import com.iemr.hwc.repo.benFlowStatus.BeneficiaryFlowStatusRepo; import com.iemr.hwc.repo.foetalmonitor.FoetalMonitorRepo; import com.iemr.hwc.repo.nurse.BenAnthropometryRepo; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; import com.iemr.hwc.repo.nurse.anc.ANCCareRepo; import com.iemr.hwc.repo.nurse.anc.ANCDiagnosisRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; import com.iemr.hwc.repo.nurse.anc.BenMedHistoryRepo; import com.iemr.hwc.repo.nurse.anc.BenMenstrualDetailsRepo; import com.iemr.hwc.repo.nurse.anc.BencomrbidityCondRepo; import com.iemr.hwc.repo.nurse.anc.FemaleObstetricHistoryRepo; import com.iemr.hwc.repo.nurse.anc.SysObstetricExaminationRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -125,6 +129,16 @@ public class ANCServiceImpl implements ANCService { @Autowired private SysObstetricExaminationRepo sysObstetricExaminationRepo; + + @Autowired + private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Autowired public void setLabTechnicianServiceImpl(LabTechnicianServiceImpl labTechnicianServiceImpl) { @@ -160,7 +174,6 @@ public void setAncNurseServiceImpl(ANCNurseServiceImpl ancNurseServiceImpl) { private SMSGatewayServiceImpl sMSGatewayServiceImpl; @Override - @Transactional(rollbackFor = Exception.class) public String saveANCNurseData(JsonObject requestOBJ, String Authorization) throws Exception { // String vr = ""; // String vc = ""; @@ -264,6 +277,26 @@ public String saveANCNurseData(JsonObject requestOBJ, String Authorization) thro } return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } private int updateBenFlowNurseAfterNurseActivityANC(JsonObject investigationDataCheck, JsonObject tmpOBJ, Long benVisitID, Long benFlowID, Long visitCode, Integer vanID, TeleconsultationRequestOBJ tcRequestOBJ) { diff --git a/src/main/java/com/iemr/hwc/service/cancerScreening/CSService.java b/src/main/java/com/iemr/hwc/service/cancerScreening/CSService.java index ac6e88aa..fa012691 100644 --- a/src/main/java/com/iemr/hwc/service/cancerScreening/CSService.java +++ b/src/main/java/com/iemr/hwc/service/cancerScreening/CSService.java @@ -34,6 +34,8 @@ public interface CSService { public int UpdateCSHistoryNurseData(JsonObject jsnOBJ) throws Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; public int updateBenVitalDetail(BenCancerVitalDetail benCancerVitalDetail); diff --git a/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java b/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java index 66b06121..fdbf91d8 100644 --- a/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java @@ -59,6 +59,10 @@ import com.iemr.hwc.data.tele_consultation.TcSpecialistSlotBookingRequestOBJ; import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; import com.iemr.hwc.repo.benFlowStatus.BeneficiaryFlowStatusRepo; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.repo.registrar.RegistrarRepoBenData; import com.iemr.hwc.repo.tc_consultation.TCRequestModelRepo; import com.iemr.hwc.service.anc.Utility; @@ -96,6 +100,15 @@ public class CSServiceImpl implements CSService { private CommonServiceImpl commonServiceImpl; @Autowired private TCRequestModelRepo tCRequestModelRepo; + + private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Autowired public void setBeneficiaryFlowStatusRepo(BeneficiaryFlowStatusRepo beneficiaryFlowStatusRepo) { @@ -147,7 +160,6 @@ public void setCsOncologistServiceImpl(CSOncologistServiceImpl csOncologistServi * @param requestOBJ * @throws Exception */ - @Transactional(rollbackFor = Exception.class) public String saveCancerScreeningNurseData(JsonObject requestOBJ, String Authorization) throws Exception { Long nurseDataSuccessFlag = null; TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -283,6 +295,26 @@ else if (nurseDataSuccessFlag == 2) } return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } // method for updating ben flow status flag for nurse private int updateBenStatusFlagAfterNurseSaveSuccess(BeneficiaryVisitDetail benVisitDetailsOBJ, Long benVisitID, diff --git a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java index a8ec6ca2..523a5b6a 100644 --- a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java @@ -35,6 +35,10 @@ import java.util.Map; import java.util.Objects; + +import javax.persistence.PersistenceContext; +import javax.transaction.Transactional; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -153,8 +157,9 @@ public class CommonNurseServiceImpl implements CommonNurseService { private Integer oncoWL; @Value("${TMReferredWL}") private Integer TMReferredWL; - + private BenVisitDetailRepo benVisitDetailRepo; + private BenChiefComplaintRepo benChiefComplaintRepo; private BenMedHistoryRepo benMedHistoryRepo; private BencomrbidityCondRepo bencomrbidityCondRepo; @@ -176,7 +181,6 @@ public class CommonNurseServiceImpl implements CommonNurseService { private SysCentralNervousExaminationRepo sysCentralNervousExaminationRepo; private SysMusculoskeletalSystemExaminationRepo sysMusculoskeletalSystemExaminationRepo; private SysGenitourinarySystemExaminationRepo sysGenitourinarySystemExaminationRepo; - @Autowired private OralExaminationRepo oralExaminationRepo; private RegistrarRepoBenData registrarRepoBenData; private PrescriptionDetailRepo prescriptionDetailRepo; @@ -191,9 +195,8 @@ public class CommonNurseServiceImpl implements CommonNurseService { private PhysicalActivityTypeRepo physicalActivityTypeRepo; private IDRSDataRepo iDRSDataRepo; private BenCancerVitalDetailRepo benCancerVitalDetailRepo; - + private CommonDoctorServiceImpl commonDoctorServiceImpl; - @Autowired private BenReferDetailsRepo benReferDetailsRepo; @Autowired private CDSSRepo cdssRepo; diff --git a/src/main/java/com/iemr/hwc/service/common/transaction/CommonServiceImpl.java b/src/main/java/com/iemr/hwc/service/common/transaction/CommonServiceImpl.java index caa0625f..19087979 100644 --- a/src/main/java/com/iemr/hwc/service/common/transaction/CommonServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/common/transaction/CommonServiceImpl.java @@ -616,7 +616,7 @@ public TeleconsultationRequestOBJ createTcRequest(JsonObject requestOBJ, CommonU throw new RuntimeException("Error while creating TC request."); } } else - throw new RuntimeException("Error while booking slot."); + throw new RuntimeException("Already Booked Slot, Please choose another slot"); } } diff --git a/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java b/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java index 79af7bdf..4e4c7924 100644 --- a/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/covid19/Covid19ServiceImpl.java @@ -60,7 +60,11 @@ import com.iemr.hwc.data.quickConsultation.PrescribedDrugDetail; import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; import com.iemr.hwc.repo.nurse.covid19.Covid19BenFeedbackRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.repo.quickConsultation.PrescriptionDetailRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; @@ -94,9 +98,14 @@ public class Covid19ServiceImpl implements Covid19Service { private Covid19BenFeedbackRepo covid19BenFeedbackRepo; @Autowired private PrescriptionDetailRepo prescriptionDetailRepo; + + @Autowired + private BenVisitDetailRepo benVisitDetailRepo; + + @Autowired + private CDSSRepo cdssRepo; @Override - @Transactional(rollbackFor = Exception.class) public String saveCovid19NurseData(JsonObject requestOBJ, String Authorization) throws Exception { Long saveSuccessFlag = null; TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -201,6 +210,24 @@ public String saveCovid19NurseData(JsonObject requestOBJ, String Authorization) } return new Gson().toJson(responseMap); } + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + cdssRepo.deleteVisitDetails(visitCode); + covid19BenFeedbackRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } /** * diff --git a/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningService.java b/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningService.java index 8313d48e..4f5e532b 100644 --- a/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningService.java +++ b/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningService.java @@ -31,6 +31,8 @@ public interface FamilyPlanningService { // save public String saveNurseDataFP(JsonObject requestOBJ, String Authorization) throws Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; public int saveDoctorDataFP(JsonObject requestOBJ, String Authorization) throws Exception; diff --git a/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java b/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java index 90862779..9e8f7c67 100644 --- a/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/family_planning/FamilyPlanningServiceImpl.java @@ -53,6 +53,10 @@ import com.iemr.hwc.repo.family_planning.FPDispenseDetailsRepo; import com.iemr.hwc.repo.family_planning.FPIecCounsellingDetailsRepo; import com.iemr.hwc.repo.family_planning.FamilyPlanningReproductiveRepo; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -95,9 +99,17 @@ public class FamilyPlanningServiceImpl implements FamilyPlanningService { @Autowired private CommonBenStatusFlowServiceImpl commonBenStatusFlowServiceImpl; + @Autowired + private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Override - @Transactional(rollbackFor = Exception.class) public String saveNurseDataFP(JsonObject requestOBJ, String Authorization) throws Exception { // logic to parse and save data in DB @@ -253,6 +265,26 @@ public String saveNurseDataFP(JsonObject requestOBJ, String Authorization) throw return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } // method for updating ben flow status flag for nurse private int updateBenStatusFlagAfterNurseSaveSuccess(JsonObject tmpOBJ, Long benVisitID, Long benFlowID, diff --git a/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDService.java b/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDService.java index b0004984..0e2ae158 100644 --- a/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDService.java +++ b/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDService.java @@ -29,6 +29,8 @@ public interface GeneralOPDService { String saveNurseData(JsonObject requestOBJ, String Authorization) throws Exception; + + void deleteVisitDetails(JsonObject requestOBJ) throws Exception; Map saveBenVisitDetails(JsonObject visitDetailsOBJ, CommonUtilityClass nurseUtilityClass) throws Exception; diff --git a/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java b/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java index 2b1dfa99..ecc887e0 100644 --- a/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/generalOPD/GeneralOPDServiceImpl.java @@ -72,6 +72,9 @@ import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -108,10 +111,17 @@ public class GeneralOPDServiceImpl implements GeneralOPDService { private FamilyPlanningService familyPlanningService; @Autowired private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; /// --------------- start of saving nurse data ------------------------ @Override - @Transactional(rollbackFor = Exception.class) +// @Transactional(rollbackFor = Exception.class) public String saveNurseData(JsonObject requestOBJ, String Authorization) throws Exception { Long historySaveSuccessFlag = null; Long vitalSaveSuccessFlag = null; @@ -211,6 +221,26 @@ public String saveNurseData(JsonObject requestOBJ, String Authorization) throws return new Gson().toJson(responseMap); } + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } + // method for updating ben flow status flag for nurse private int updateBenStatusFlagAfterNurseSaveSuccess(JsonObject tmpOBJ, Long benVisitID, Long benFlowID, Long benVisitCode, Integer vanID, TeleconsultationRequestOBJ tcRequestOBJ) { diff --git a/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareService.java b/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareService.java index 3660cd21..d86d90dd 100644 --- a/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareService.java +++ b/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareService.java @@ -26,5 +26,7 @@ public interface NCDCareService { String saveNCDCareNurseData(JsonObject requestOBJ, String Authorization) throws Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; } diff --git a/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java b/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java index 223f5d57..25625f6c 100644 --- a/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/ncdCare/NCDCareServiceImpl.java @@ -63,6 +63,12 @@ import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; import com.iemr.hwc.data.snomedct.SCTDescription; import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; +import com.iemr.hwc.repo.quickConsultation.LabTestOrderDetailRepo; +import com.iemr.hwc.repo.quickConsultation.PrescriptionDetailRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -84,6 +90,20 @@ public class NCDCareServiceImpl implements NCDCareService { private CommonServiceImpl commonServiceImpl; @Autowired private TeleConsultationServiceImpl teleConsultationServiceImpl; + + @Autowired + private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; + @Autowired + private PrescriptionDetailRepo prescriptionDetailRepo; + @Autowired + private LabTestOrderDetailRepo labTestOrderDetailRepo; @Autowired public void setLabTechnicianServiceImpl(LabTechnicianServiceImpl labTechnicianServiceImpl) { @@ -114,7 +134,6 @@ public void setCommonNurseServiceImpl(CommonNurseServiceImpl commonNurseServiceI private SMSGatewayServiceImpl sMSGatewayServiceImpl; @Override - @Transactional(rollbackFor = Exception.class) public String saveNCDCareNurseData(JsonObject requestOBJ, String Authorization) throws Exception { Long saveSuccessFlag = null; TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -209,6 +228,28 @@ public String saveNCDCareNurseData(JsonObject requestOBJ, String Authorization) } return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + labTestOrderDetailRepo.deleteVisitDetails(visitCode); + prescriptionDetailRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } // method for updating ben flow status flag for nurse private int updateBenFlowNurseAfterNurseActivityANC(JsonObject investigationDataCheck, JsonObject tmpOBJ, diff --git a/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningService.java b/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningService.java index f6c3c53e..220fc46a 100644 --- a/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningService.java +++ b/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningService.java @@ -27,6 +27,8 @@ public interface NCDScreeningService { public String getNCDScreeningDetails(Long beneficiaryRegID, Long benVisitID); + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; String saveNCDScreeningNurseData(JsonObject requestOBJ, String Authorization) throws Exception; diff --git a/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java b/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java index 66745dcf..a71dd78d 100644 --- a/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/ncdscreening/NCDScreeningServiceImpl.java @@ -75,6 +75,8 @@ import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; import com.iemr.hwc.repo.benFlowStatus.BeneficiaryFlowStatusRepo; import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; import com.iemr.hwc.repo.nurse.ncdscreening.BreastCancerScreeningRepo; import com.iemr.hwc.repo.nurse.ncdscreening.CbacDetailsRepo; import com.iemr.hwc.repo.nurse.ncdscreening.CervicalCancerScreeningRepo; @@ -82,6 +84,7 @@ import com.iemr.hwc.repo.nurse.ncdscreening.HypertensionScreeningRepo; import com.iemr.hwc.repo.nurse.ncdscreening.IDRSDataRepo; import com.iemr.hwc.repo.nurse.ncdscreening.OralCancerScreeningRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.repo.quickConsultation.PrescriptionDetailRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; @@ -141,6 +144,14 @@ public class NCDScreeningServiceImpl implements NCDScreeningService { @Autowired private CommonNcdScreeningService commonNcdScreeningService; + + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Autowired public void setLabTechnicianServiceImpl(LabTechnicianServiceImpl labTechnicianServiceImpl) { @@ -175,7 +186,6 @@ public void setCommonDoctorServiceImpl(CommonDoctorServiceImpl commonDoctorServi private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); @Override - @Transactional(rollbackFor = Exception.class) public String saveNCDScreeningNurseData(JsonObject requestOBJ, String Authorization) throws Exception { // Shubham Shekhar,8-12-2020,WDF Long saveSuccessFlag = null; @@ -408,6 +418,26 @@ public String saveNCDScreeningNurseData(JsonObject requestOBJ, String Authorizat return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } // method for updating ben flow status flag for nurse private int updateBenFlowNurseAfterNurseActivityANC(JsonObject tmpOBJ, Long benVisitID, Long benFlowID, diff --git a/src/main/java/com/iemr/hwc/service/neonatal/NeonatalService.java b/src/main/java/com/iemr/hwc/service/neonatal/NeonatalService.java index 01cf7307..61bb2739 100644 --- a/src/main/java/com/iemr/hwc/service/neonatal/NeonatalService.java +++ b/src/main/java/com/iemr/hwc/service/neonatal/NeonatalService.java @@ -30,6 +30,8 @@ public interface NeonatalService { public String saveNurseData(JsonObject requestOBJ, String Authorization) throws SQLException, Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; public String getBenVisitDetailsFrmNurseNNI(Long benRegID, Long visitCode) throws Exception; diff --git a/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java b/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java index 48461846..04232a2a 100644 --- a/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/neonatal/NeonatalServiceImpl.java @@ -58,6 +58,9 @@ import com.iemr.hwc.repo.neonatal.ImmunizationServicesRepo; import com.iemr.hwc.repo.neonatal.InfantBirthDetailsRepo; import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -93,9 +96,16 @@ public class NeonatalServiceImpl implements NeonatalService { private GeneralOPDDoctorServiceImpl generalOPDDoctorServiceImpl; @Autowired private LabTechnicianServiceImpl labTechnicianServiceImpl; + + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Override - @Transactional(rollbackFor = Exception.class) public String saveNurseData(JsonObject requestOBJ, String Authorization) throws SQLException, Exception { Map responseMap = new HashMap(); @@ -226,6 +236,26 @@ public String saveNurseData(JsonObject requestOBJ, String Authorization) throws return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } /// --------------- start of saving doctor data ------------------------ @Override diff --git a/src/main/java/com/iemr/hwc/service/pnc/PNCService.java b/src/main/java/com/iemr/hwc/service/pnc/PNCService.java index 156cc15f..39b19153 100644 --- a/src/main/java/com/iemr/hwc/service/pnc/PNCService.java +++ b/src/main/java/com/iemr/hwc/service/pnc/PNCService.java @@ -26,6 +26,8 @@ public interface PNCService { String savePNCNurseData(JsonObject requestOBJ, String Authorization) throws Exception; + + void deleteVisitDetails(JsonObject requestOBJ) throws Exception; String getBenVisitDetailsFrmNursePNC(Long benRegID, Long benVisitID); diff --git a/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java b/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java index df8b7f4f..a2846133 100644 --- a/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/pnc/PNCServiceImpl.java @@ -71,6 +71,10 @@ import com.iemr.hwc.data.quickConsultation.PrescriptionDetail; import com.iemr.hwc.data.tele_consultation.TeleconsultationRequestOBJ; import com.iemr.hwc.repo.benFlowStatus.BeneficiaryFlowStatusRepo; +import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; +import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; +import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.service.benFlowStatus.CommonBenStatusFlowServiceImpl; import com.iemr.hwc.service.common.transaction.CommonDoctorServiceImpl; import com.iemr.hwc.service.common.transaction.CommonNurseServiceImpl; @@ -131,9 +135,18 @@ public void setPncNurseServiceImpl(PNCNurseServiceImpl pncNurseServiceImpl) { @Autowired private BeneficiaryFlowStatusRepo beneficiaryFlowStatusRepo; + + @Autowired + private BenVisitDetailRepo benVisitDetailRepo; + @Autowired + private BenChiefComplaintRepo benChiefComplaintRepo; + @Autowired + private BenAdherenceRepo benAdherenceRepo; + + @Autowired + private CDSSRepo cdssRepo; @Override - @Transactional(rollbackFor = Exception.class) public String savePNCNurseData(JsonObject requestOBJ, String Authorization) throws Exception { Long saveSuccessFlag = null; TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -244,6 +257,26 @@ public String savePNCNurseData(JsonObject requestOBJ, String Authorization) thro } return new Gson().toJson(responseMap); } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } // method for updating ben flow status flag for nurse private int updateBenStatusFlagAfterNurseSaveSuccess(JsonObject tmpOBJ, Long benVisitID, Long benFlowID, diff --git a/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationService.java b/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationService.java index 7c2a70aa..a5b0e704 100644 --- a/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationService.java +++ b/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationService.java @@ -47,4 +47,6 @@ public Integer quickConsultDoctorDataInsert(JsonObject quickConsultDoctorOBJ, St throws Exception; Integer updateBeneficiaryClinicalObservations(JsonObject caseSheet) throws Exception; + + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception; } diff --git a/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java b/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java index 0b4bce30..63b20268 100644 --- a/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java @@ -50,6 +50,7 @@ import com.iemr.hwc.repo.nurse.BenPhysicalVitalRepo; import com.iemr.hwc.repo.nurse.BenVisitDetailRepo; import com.iemr.hwc.repo.nurse.CDSSRepo; +import com.iemr.hwc.repo.nurse.anc.BenAdherenceRepo; import com.iemr.hwc.repo.quickConsultation.BenChiefComplaintRepo; import com.iemr.hwc.repo.quickConsultation.BenClinicalObservationsRepo; import com.iemr.hwc.repo.quickConsultation.ExternalTestOrderRepo; @@ -96,6 +97,9 @@ public class QuickConsultationServiceImpl implements QuickConsultationService { private BenVisitDetailRepo benVisitDetailRepo; @Autowired private CDSSRepo cdssRepo; + + @Autowired + private BenAdherenceRepo benAdherenceRepo; @Override public Long saveBeneficiaryChiefComplaint(JsonObject caseSheet) { @@ -290,6 +294,26 @@ public String quickConsultNurseDataInsert(JsonObject jsnOBJ, String Authorizatio return new Gson().toJson(responseMap); // return returnOBJ; } + + @Override + public void deleteVisitDetails(JsonObject requestOBJ) throws Exception { + if (requestOBJ != null && requestOBJ.has("visitDetails") && !requestOBJ.get("visitDetails").isJsonNull()) { + + CommonUtilityClass nurseUtilityClass = InputMapper.gson().fromJson(requestOBJ, CommonUtilityClass.class); + + Long visitCode = benVisitDetailRepo.getVisitCode(nurseUtilityClass.getBeneficiaryRegID(), + nurseUtilityClass.getProviderServiceMapID()); + + if (visitCode != null) { + benChiefComplaintRepo.deleteVisitDetails(visitCode); + benAdherenceRepo.deleteVisitDetails(visitCode); + cdssRepo.deleteVisitDetails(visitCode); + benVisitDetailRepo.deleteVisitDetails(visitCode); + } + + } + + } // method for updating ben flow status flag for nurse private int updateBenStatusFlagAfterNurseSaveSuccess(BeneficiaryVisitDetail benVisitDetailsOBJ, Long benVisitID, diff --git a/src/test/java/com/iemr/mmu/ncdCare/TestNCDCareController.java b/src/test/java/com/iemr/mmu/ncdCare/TestNCDCareController.java index ad8ce05f..aa51ea55 100644 --- a/src/test/java/com/iemr/mmu/ncdCare/TestNCDCareController.java +++ b/src/test/java/com/iemr/mmu/ncdCare/TestNCDCareController.java @@ -40,7 +40,7 @@ public class TestNCDCareController { @BeforeClass public static void initializeParams() { - createController.setNcdCareServiceImpl(ncdCareServiceImplMock); + // createController.setNcdCareServiceImpl(ncdCareServiceImplMock); nurseObjPve = "{\"visitDetails\": { \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"visitNo\": null, \"visitReason\": \"Screening\", \"visitCategory\": \"Cancer Screening\", \"pregnancyStatus\": \"Yes\", \"rCHID\": \"7777\", \"healthFacilityType\": null, \"healthFacilityLocation\": null, \"reportFilePath\": null, \"createdBy\": \"888\" }, \"vitalsDetails\": { \"beneficiaryRegID\": \"7506\", \"benVisitID\": null, \"providerServiceMapID\": \"1320\", \"weight_Kg\": \"64\", \"height_cm\": \"166\", \"waistCircumference_cm\": \"56\", \"systolicBP_1stReading\": \"120\", \"diastolicBP_1stReading\": \"65\", \"systolicBP_2ndReading\": \"113\", \"diastolicBP_2ndReading\": \"73\", \"systolicBP_3rdReading\": \"123\", \"diastolicBP_3rdReading\": \"66\", \"hbA1C\": \"4\", \"hemoglobin\": \"14\", \"bloodGlucose_Fasting\": \"123\", \"bloodGlucose_Random\": \"143\", \"bloodGlucose_2HrPostPrandial\": \"145\", \"createdBy\": \"888\" }, \"examinationDetails\": { \"signsDetails\": { \"cancerSignAndSymptoms\": { \"shortnessOfBreath\": null, \"coughgt2Weeks\": true, \"bloodInSputum\": true, \"difficultyInOpeningMouth\": true, \"nonHealingUlcerOrPatchOrGrowth\": null, \"changeInTheToneOfVoice\": null, \"lumpInTheBreast\": null, \"bloodStainedDischargeFromNipple\": null, \"changeInShapeAndSizeOfBreasts\": null, \"vaginalBleedingBetweenPeriods\": null, \"vaginalBleedingAfterMenopause\": null, \"vaginalBleedingAfterIntercourse\": null, \"foulSmellingVaginalDischarge\": null, \"lymphNode_Enlarged\": true, \"breastEnlargement\": null, \"observation\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry\", \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" }, \"cancerLymphNodeDetails\": [ { \"lymphNodeName\": \" Sub Mandibular\", \"size_Left\": \"3-6 cm\", \"mobility_Left\": true, \"size_Right\": \"3-6 cm\", \"mobility_Right\": true, \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" } ] }, \"oralDetails\": { \"limitedMouthOpening\": \"+\", \"premalignantLesions\": true, \"preMalignantLesionTypeList\": [ \"Sub muscus fibrosis\" ], \"prolongedIrritation\": null, \"chronicBurningSensation\": null, \"observation\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry\", \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" }, \"breastDetails\": { \"everBreastFed\": true, \"breastFeedingDurationGTE6months\": true, \"breastsAppear_Normal\": true, \"rashOnBreast\": null, \"dimplingSkinOnBreast\": true, \"dischargeFromNipple\": null, \"peaudOrange\": null, \"lumpInBreast\": null, \"lumpSize\": null, \"lumpShape\": null, \"lumpTexture\": null, \"referredToMammogram\": null, \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" }, \"abdominalDetails\": { \"abdominalInspection_Normal\": true, \"liver\": \"Not palpable\", \"ascites_Present\": true, \"anyOtherMass_Present\": true, \"lymphNodes_Enlarged\": null, \"lymphNode_Inguinal_Left\": null, \"lymphNode_Inguinal_Right\": null, \"lymphNode_ExternalIliac_Left\": null, \"lymphNode_ExternalIliac_Right\": null, \"lymphNode_ParaAortic_Left\": null, \"lymphNode_ParaAortic_Right\": null, \"observation\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry\", \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" }, \"gynecologicalDetails\": { \"appearanceOfCervix\": null, \"typeOfLesionList\": null, \"vulvalInvolvement\": null, \"vaginalInvolvement\": true, \"uterus_Normal\": true, \"sufferedFromRTIOrSTI\": null, \"rTIOrSTIDetail\": null, \"filePath\": null, \"experiencedPostCoitalBleeding\": null, \"observation\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry\", \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" }, \"imageCoordinates\": [ { \"beneficiaryRegID\": \"7506\", \"visitID\": null, \"createdBy\": \"888\", \"imageID\": 3, \"providerServiceMapID\": \"1320\", \"markers\": [ { \"xCord\": 97, \"yCord\": 174, \"description\": \"one\", \"point\": 1 } ] }, { \"beneficiaryRegID\": \"7506\", \"visitID\": null, \"createdBy\": \"888\", \"imageID\": 1, \"providerServiceMapID\": \"1320\", \"markers\": [ { \"xCord\": 146, \"yCord\": 184, \"description\": \"three\", \"point\": 1 } ] }, { \"beneficiaryRegID\": \"7506\", \"visitID\": null, \"createdBy\": \"888\", \"imageID\": 4, \"providerServiceMapID\": \"1320\", \"markers\": [ { \"xCord\": 102, \"yCord\": 154, \"description\": \"four\", \"point\": 1 } ] }, { \"beneficiaryRegID\": \"7506\", \"visitID\": null, \"createdBy\": \"888\", \"imageID\": 2, \"providerServiceMapID\": \"1320\", \"markers\": [ { \"xCord\": 171, \"yCord\": 156, \"description\": \"two\", \"point\": 1 } ] } ] }, \"historyDetails\": { \"familyHistory\": { \"diseases\": [ { \"beneficiaryRegID\": \"7506\", \"benVisitID\": null, \"providerServiceMapID\": \"1320\", \"cancerDiseaseType\": \"Breast Cancer\", \"otherDiseaseType\": null, \"familyMemberList\": [ \"Aunt\", \"Brother\" ], \"createdBy\": \"888\" }, { \"beneficiaryRegID\": \"7506\", \"benVisitID\": null, \"providerServiceMapID\": \"1320\", \"cancerDiseaseType\": \"lorem ipsum\", \"otherDiseaseType\": \"lorem ipsum\", \"familyMemberList\": [ \"Grand Father\" ], \"createdBy\": \"888\" } ], \"beneficiaryRegID\": \"7506\", \"providerServiceMapID\": \"1320\", \"createdBy\": \"888\" }, \"personalHistory\": { \"beneficiaryRegID\": \"7506\", \"benVisitID\": null, \"providerServiceMapID\": \"1320\", \"tobaccoUse\": \"Used in Past\", \"startAge_year\": \"23\", \"endAge_year\": \"24\", \"typeOfTobaccoProductList\": [ \"Beedi\", \"Chewing\", \"Cigarettes\" ], \"quantityPerDay\": \"2\", \"isFilteredCigaerette\": true, \"isCigaretteExposure\": false, \"isBetelNutChewing\": true, \"durationOfBetelQuid\": \"12\", \"alcoholUse\": \"Currently Using\", \"ssAlcoholUsed\": true, \"frequencyOfAlcoholUsed\": \"1-4 days/week\", \"dietType\": \"Eggetarian\", \"otherDiet\": null, \"intakeOfOutsidePreparedMeal\": \"2\", \"fruitConsumptionDays\": \"2\", \"fruitQuantityPerDay\": \"2\", \"vegetableConsumptionDays\": \"2\", \"vegetableQuantityPerDay\": \"2\", \"typeOfOilConsumedList\": [ \"Coconut Oil\", \"Corn Oil\" ], \"otherOilType\": null, \"physicalActivityType\": \"Light Activity\", \"ssRadiationExposure\": false, \"isThyroidDisorder\": false, \"createdBy\": \"888\" }, \"pastObstetricHistory\": { \"beneficiaryRegID\": \"7506\", \"benVisitID\": null, \"providerServiceMapID\": \"1320\", \"pregnancyStatus\": \"Yes\", \"isUrinePregTest\": null, \"pregnant_No\": \"1\", \"noOfLivingChild\": \"1\", \"isAbortion\": false, \"isOralContraceptiveUsed\": false, \"isHormoneReplacementTherapy\": false, \"menarche_Age\": \"13\", \"isMenstrualCycleRegular\": true, \"menstrualCycleLength\": \"28\", \"menstrualFlowDuration\": \"3\", \"menstrualFlowType\": \"Little\", \"isDysmenorrhea\": false, \"isInterMenstrualBleeding\": false, \"menopauseAge\": null, \"isPostMenopauseBleeding\": null, \"createdBy\": \"888\" } } }"; doctorObjPve = "{ \"findings\":{ \"beneficiaryRegID\":\"7866\", \"benVisitID\":\"1040\", \"providerServiceMapID\":\"1320\", \"clinicalObservation\":\"Content here, content here\", \"otherSymptoms\":\"Content here, content here\", \"significantFindings\":\"Content here, content here\", \"complaints\":[ { \"chiefComplaint\":\"Abdominal Bloating\", \"chiefComplaintID\":1, \"duration\":\"23\", \"unitOfDuration\":\"Hours\", \"description\":\"content here, content here\" } ], \"createdBy\":\"888\" }, \"diagnosis\":{ \"ncdCareConditionID\":null, \"ncdCareCondition\":null, \"ncdCareTypeID\":null, \"ncdCareType\":null, \"ncdComplication\":\"Content here, content here\", \"beneficiaryRegID\":\"7866\", \"benVisitID\":\"1040\", \"providerServiceMapID\":\"1320\", \"createdBy\":\"888\" }, \"investigation\":{ \"externalInvestigation\":\"Content here, content here\", \"beneficiaryRegID\":\"7866\", \"benVisitID\":\"1040\", \"providerServiceMapID\":\"1320\", \"createdBy\":\"888\", \"laboratoryList\":[ { \"testID\":2, \"testName\":\"Blood Glucose Measurement\", \"isRadiologyImaging\":false }, { \"testID\":12, \"testName\":\"Blood grouping and Rh typing \", \"isRadiologyImaging\":false }, { \"testID\":17, \"testName\":\"BUN, Creatinine, Uric acid\", \"isRadiologyImaging\":false }, { \"testID\":29, \"testName\":\"CT Brain\", \"isRadiologyImaging\":true }, { \"testID\":30, \"testName\":\"CT Whole Spine \", \"isRadiologyImaging\":true }, { \"testID\":33, \"testName\":\"Flouroscopy- Urethrogram \", \"isRadiologyImaging\":true } ] }, \"prescription\":{ \"prescribedDrugs\":[ { \"specialInstruction\":\"After Food\", \"genericDrugName\":\"Ciprofloxacin Hcl Eye /Ear Drops IP 0.3% w/v in 5 ml\", \"dose\":\"Days \", \"frequency\":\"Thrice Daily (TID)\", \"drugForm\":\"Tablet\", \"drugDuration\":\"21\", \"qih\":3 } ], \"beneficiaryRegID\":\"7866\", \"benVisitID\":\"1040\", \"providerServiceMapID\":\"1320\", \"createdBy\":\"888\" }, \"refer\":{ \"referredToInstituteID\":null, \"refrredToAdditionalServiceList\":[ 3, 1, 5 ], \"beneficiaryRegID\":\"7866\", \"benVisitID\":\"1040\", \"providerServiceMapID\":\"1320\", \"createdBy\":\"888\" } }"; From 0a86b08e05e1612324dc4ba87833be301567f8c7 Mon Sep 17 00:00:00 2001 From: appuser Date: Fri, 8 Dec 2023 18:10:44 +0530 Subject: [PATCH 24/26] casesheet print data issue fixed --- .../hwc/service/common/transaction/CommonNurseServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java index 523a5b6a..4ce5ab44 100644 --- a/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/common/transaction/CommonNurseServiceImpl.java @@ -181,6 +181,7 @@ public class CommonNurseServiceImpl implements CommonNurseService { private SysCentralNervousExaminationRepo sysCentralNervousExaminationRepo; private SysMusculoskeletalSystemExaminationRepo sysMusculoskeletalSystemExaminationRepo; private SysGenitourinarySystemExaminationRepo sysGenitourinarySystemExaminationRepo; + @Autowired private OralExaminationRepo oralExaminationRepo; private RegistrarRepoBenData registrarRepoBenData; private PrescriptionDetailRepo prescriptionDetailRepo; From ca4e24c410eaa2b2a1ed75ff59c17ee508b440bb Mon Sep 17 00:00:00 2001 From: appuser Date: Mon, 11 Dec 2023 14:25:20 +0530 Subject: [PATCH 25/26] new serviceline changes --- .../hwc/service/cancerScreening/CSServiceImpl.java | 2 +- .../common/transaction/CommonDoctorServiceImpl.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java b/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java index fdbf91d8..f401f14b 100644 --- a/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/cancerScreening/CSServiceImpl.java @@ -825,7 +825,7 @@ public Long saveCancerScreeningDoctorData(JsonObject requestOBJ, String Authoriz CommonUtilityClass.class); if (commonUtilityClass != null && commonUtilityClass.getServiceID() != null - && commonUtilityClass.getServiceID() == 4 && requestOBJ != null && requestOBJ.has("tcRequest") + && commonUtilityClass.getServiceID() == 9 && requestOBJ != null && requestOBJ.has("tcRequest") && requestOBJ.get("tcRequest") != null) { tcRequestOBJ = InputMapper.gson().fromJson(requestOBJ.get("tcRequest"), diff --git a/src/main/java/com/iemr/hwc/service/common/transaction/CommonDoctorServiceImpl.java b/src/main/java/com/iemr/hwc/service/common/transaction/CommonDoctorServiceImpl.java index c9a89bec..5f10ebf0 100644 --- a/src/main/java/com/iemr/hwc/service/common/transaction/CommonDoctorServiceImpl.java +++ b/src/main/java/com/iemr/hwc/service/common/transaction/CommonDoctorServiceImpl.java @@ -394,7 +394,7 @@ public String getDocWorkListNew(Integer providerServiceMapId, Integer serviceID, docWorkList = beneficiaryFlowStatusRepo.getDocWorkListNew(providerServiceMapId); } // TC doc work-list - else if (serviceID != null && serviceID == 4) { + else if (serviceID != null && serviceID == 9) { docWorkList = beneficiaryFlowStatusRepo.getDocWorkListNewTC(providerServiceMapId, new Timestamp(sevenDaysAgo), vanID); } @@ -408,7 +408,7 @@ public String getDocWorkListNewFutureScheduledForTM(Integer providerServiceMapId ArrayList docWorkListFutureScheduled = new ArrayList<>(); - if (serviceID != null && serviceID == 4) { + if (serviceID != null && serviceID == 9) { docWorkListFutureScheduled = beneficiaryFlowStatusRepo .getDocWorkListNewFutureScheduledTC(providerServiceMapId, vanID); } @@ -426,7 +426,7 @@ public String getTCSpecialistWorkListNewForTMPatientApp(Integer providerServiceM long sevenDaysAgo = cal.getTimeInMillis(); ArrayList tcSpecialistWorkList = new ArrayList<>(); - if (serviceID != null && serviceID == 4) { + if (serviceID != null && serviceID == 9) { tcSpecialistWorkList = beneficiaryFlowStatusRepo.getTCSpecialistWorkListNewPatientApp(providerServiceMapId, userID, new Timestamp(sevenDaysAgo), vanID); } @@ -443,7 +443,7 @@ public String getTCSpecialistWorkListNewForTM(Integer providerServiceMapId, Inte long sevenDaysAgo = cal.getTimeInMillis(); ArrayList tcSpecialistWorkList = new ArrayList<>(); - if (serviceID != null && serviceID == 4) { + if (serviceID != null && serviceID == 9) { tcSpecialistWorkList = beneficiaryFlowStatusRepo.getTCSpecialistWorkListNew(providerServiceMapId, userID, new Timestamp(sevenDaysAgo)); } @@ -455,7 +455,7 @@ public String getTCSpecialistWorkListNewFutureScheduledForTM(Integer providerSer Integer serviceID) { ArrayList tcSpecialistWorkListFutureScheduled = new ArrayList<>(); - if (serviceID != null && serviceID == 4) { + if (serviceID != null && serviceID == 9) { tcSpecialistWorkListFutureScheduled = beneficiaryFlowStatusRepo .getTCSpecialistWorkListNewFutureScheduled(providerServiceMapId, userID); } @@ -716,7 +716,7 @@ public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityCl Long tmpbeneficiaryRegID = commonUtilityClass.getBeneficiaryRegID(); if (commonUtilityClass != null && commonUtilityClass.getVisitCategoryID() != null - && commonUtilityClass.getVisitCategoryID() == 4) { + && commonUtilityClass.getVisitCategoryID() == 9) { ArrayList foetalMonitorData = foetalMonitorRepo.getFoetalMonitorDetailsByFlowId(tmpBenFlowID); if (foetalMonitorData.size() > 0) { labTechnicianFlag = 3; From 3efd333c8496ded5fd5be11382e774e587c2dce0 Mon Sep 17 00:00:00 2001 From: Shrey475 Date: Mon, 11 Dec 2023 15:36:58 +0530 Subject: [PATCH 26/26] Added Identity-API url to get count of beneficiaries in all the properties files. --- src/main/environment/common_ci.properties | 4 +++- src/main/environment/common_dev.properties | 4 +++- src/main/environment/common_example.properties | 4 +++- src/main/environment/common_prod.properties | 4 +++- src/main/environment/common_test.properties | 4 +++- src/main/environment/common_uat.properties | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index d44e0666..9c567be9 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -12,7 +12,9 @@ carestreamOrderCreateURL =@env.COMMON_API_BASE_URL@/carestream/createOrder # Registration registrationUrl =@env.COMMON_API_BASE_URL@/beneficiary/create -syncSearchByLocation =@env.COMMON_API_BASE_URL@/id/searchByDistrictId +syncSearchByLocation =@env.COMMON_API_BASE_URL@/id/searchByVillageIdAndLastModifiedDate + +getBenCountToSync = @env.COMMON_API_BASE_URL@/id/countBenByVillageIdAndLastModifiedDate registrarQuickSearchByIdUrl =@env.COMMON_API_BASE_URL@/beneficiary/searchUserByID diff --git a/src/main/environment/common_dev.properties b/src/main/environment/common_dev.properties index af6bd2ce..535ef2da 100644 --- a/src/main/environment/common_dev.properties +++ b/src/main/environment/common_dev.properties @@ -12,7 +12,9 @@ carestreamOrderCreateURL =/hwc-commonapi-v1.0/ca # Registration registrationUrl =/hwc-commonapi-v1.0/beneficiary/create -syncSearchByLocation =/hwc-identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/hwc-identity-0.0.1/id/searchByVillageIdAndLastModifiedDate + +getBenCountToSync =/hwc-identity-0.0.1/id/countBenByVillageIdAndLastModifiedDate registrarQuickSearchByIdUrl =/hwc-commonapi-v1.0/beneficiary/searchUserByID diff --git a/src/main/environment/common_example.properties b/src/main/environment/common_example.properties index 3bba37c5..8b1b087c 100644 --- a/src/main/environment/common_example.properties +++ b/src/main/environment/common_example.properties @@ -12,7 +12,9 @@ carestreamOrderCreateURL =http://localhost:8080/carestream/createOrder # Registration registrationUrl =http://localhost:8080/beneficiary/create -syncSearchByLocation =http://localhost:8082/id/searchByDistrictId +syncSearchByLocation =http://localhost:8082/id/searchByVillageIdAndLastModifiedDate + +getBenCountToSync = http://localhost:8082/id/countBenByVillageIdAndLastModifiedDate registrarQuickSearchByIdUrl =http://localhost:8080/beneficiary/searchUserByID diff --git a/src/main/environment/common_prod.properties b/src/main/environment/common_prod.properties index 0e5c2824..ef8e32b2 100644 --- a/src/main/environment/common_prod.properties +++ b/src/main/environment/common_prod.properties @@ -12,7 +12,9 @@ carestreamOrderCreateURL =/commonapi-v1.0/carest # Registration registrationUrl =/commonapi-v1.0/beneficiary/create -syncSearchByLocation =/identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/identity-0.0.1/id/searchByVillageIdAndLastModifiedDate + +getBenCountToSync =/identity-0.0.1/id/countBenByVillageIdAndLastModifiedDate registrarQuickSearchByIdUrl =/commonapi-v1.0/beneficiary/searchUserByID diff --git a/src/main/environment/common_test.properties b/src/main/environment/common_test.properties index aadcc528..88e67f0d 100644 --- a/src/main/environment/common_test.properties +++ b/src/main/environment/common_test.properties @@ -14,7 +14,9 @@ carestreamOrderCreateURL =/commonapi-v1.0/carest # Registration registrationUrl =/commonapi-v1.0/beneficiary/create -syncSearchByLocation =/identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/identity-0.0.1/id/searchByVillageIdAndLastModifiedDate + +getBenCountToSync =/identity-0.0.1/id/countBenByVillageIdAndLastModifiedDate registrarQuickSearchByIdUrl =/commonapi-v1.0/beneficiary/searchUserByID diff --git a/src/main/environment/common_uat.properties b/src/main/environment/common_uat.properties index 93fc2bfb..cc192b31 100644 --- a/src/main/environment/common_uat.properties +++ b/src/main/environment/common_uat.properties @@ -14,7 +14,9 @@ carestreamOrderCreateURL =/commonapi-v1.0/carest # Registration registrationUrl =/commonapi-v1.0/beneficiary/create -syncSearchByLocation =/identity-0.0.1/id/searchByDistrictId +syncSearchByLocation =/identity-0.0.1/id/searchByVillageIdAndLastModifiedDate + +getBenCountToSync =/identity-0.0.1/id/countBenByVillageIdAndLastModifiedDate registrarQuickSearchByIdUrl =/commonapi-v1.0/beneficiary/searchUserByID