Skip to content

Commit

Permalink
Merged PR 912: merge beta 2019-02-08 to master
Browse files Browse the repository at this point in the history
merge beta 2019-02-08 to master

Related work items: #614
  • Loading branch information
gitongakithinji authored and sosewe committed Feb 8, 2019
2 parents c1a3acb + d9bd368 commit 0f02853
Show file tree
Hide file tree
Showing 216 changed files with 10,968 additions and 4,155 deletions.
4 changes: 2 additions & 2 deletions Application/Application.Presentation/GblIQCare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GblIQCare
public GblIQCare()
{
AppVersion = "Ver 2.0.0 Kenya HMIS";
ReleaseDate = "10-Jan-2019";
ReleaseDate = "08-Feb-2019";
VersionName = "Kenya HMIS Ver 2.0.0 BETA";
DbVersion = "Ver 2.0.0 Kenya HMIS";
}
Expand All @@ -50,7 +50,7 @@ public GblIQCare()
#region "Application Parameters"
public static string AppVersion = "Ver 2.0.0 Kenya HMIS";
public static string DbVersion = "Ver 2.0.0 Kenya HMIS";
public static string ReleaseDate = "10-Jan-2019";
public static string ReleaseDate = "08-Feb-2019";
public static string VersionName = "Kenya HMIS Ver 2.0.0 BETA";
#endregion

Expand Down
6 changes: 6 additions & 0 deletions BusinessProcess/BusinessProcess.SCM/BDrug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ public DataTable GetPharmacyExistingRecord(int patientId, int storeId)
return (DataTable)theManager.ReturnObject(ClsUtility.theParams, "pr_SCM_GetExistingPharmacyDispense_Futures", ClsUtility.ObjectEnum.DataTable);
}

public DataTable GetmstRegimenLineClassification()
{
ClsUtility.Init_Hashtable();
ClsObject theManager = new ClsObject();
return (DataTable)theManager.ReturnObject(ClsUtility.theParams, "select * from mst_RegimenLine", ClsUtility.ObjectEnum.DataTable);
}
public DataTable GetPharmacyRegimenClassification()
{
ClsUtility.Init_Hashtable();
Expand Down
1 change: 1 addition & 0 deletions IQCare.CCC/BusinessProcess.CCC/BusinessProcess.CCC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<Compile Include="BPersonRelationshipManager.cs" />
<Compile Include="BTannersStaging.cs" />
<Compile Include="ClinicalSummary\BClinicalSummary.cs" />
<Compile Include="ClinicalSummary\BPharmacyHistoryDrugSubstitutionsSwitches.cs" />
<Compile Include="Encounters\BNeonatalHistory.cs" />
<Compile Include="Encounters\BPatientClinicalNotes.cs" />
<Compile Include="Encounters\BSocialHistory.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Data;
using DataAccess.Base;
using DataAccess.Common;
using DataAccess.Entity;
using Interface.CCC.ClinicalSummary;

namespace BusinessProcess.CCC.ClinicalSummary
{
public class BPharmacyHistoryDrugSubstitutionsSwitches : ProcessBase, IPharmacyHistoryDrugSubstitutionsSwitches
{
public List<PharmacyHistory> GetPharmacyDrugsSubstitutionsSwitchesData(int ptn_pk)
{
List<PharmacyHistory> dataList = new List<PharmacyHistory>();
ClsObject obj = new ClsObject();
ClsUtility.Init_Hashtable();
ClsUtility.AddExtendedParameters("@ptn_pk", SqlDbType.Int, ptn_pk);

DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Pharmacy_History", ClsUtility.ObjectEnum.DataTable);
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow dataRow in dt.Rows)
{
var dispensedByDate = dataRow["DispensedByDate"];
var regimentype = dataRow["regimentype"];

dataList.Add(new PharmacyHistory()
{
DispensedByDate = DateTime.Parse(dispensedByDate.ToString()),
regimentype = regimentype.ToString()
});
}
}

return dataList;
}
}
}
9 changes: 9 additions & 0 deletions IQCare.CCC/BusinessProcess.CCC/Enrollment/BIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public List<Identifier> GetAllIdentifiers()
}
}

public Identifier GetIdentifierByName(string name)
{
using (UnitOfWork unitOfWork = new UnitOfWork(new GreencardContext()))
{
var identifier = unitOfWork.IdentifierRepository.FindBy(x => x.Name==name && !x.DeleteFlag).FirstOrDefault();
unitOfWork.Dispose();
return identifier;
}
}
public Identifier GetIdentifierByCode(string code)
{
using (UnitOfWork unitOfWork = new UnitOfWork(new GreencardContext()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public List<PatientEntityEnrollment> GetPatientEnrollmentByPatientId(int patient
{
using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext()))
{
var patientEnrollmentList = _unitOfWork.PatientEnrollmentRepository.FindBy(x => x.PatientId == patientId && !x.CareEnded).ToList();
var patientEnrollmentList = _unitOfWork.PatientEnrollmentRepository.FindBy(x => x.PatientId == patientId && x.ServiceAreaId == 1 && !x.CareEnded).ToList();
_unitOfWork.Dispose();
return patientEnrollmentList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum IdentifierType
public class IdentifierManager
{
private IIdentifiersManager mgr =
(IIdentifiersManager) ObjectFactory.CreateInstance(
(IIdentifiersManager)ObjectFactory.CreateInstance(
"BusinessProcess.CCC.Enrollment.BIdentifier, BusinessProcess.CCC");

public List<Identifier> GetIdentifiersById(int identifierId)
Expand Down Expand Up @@ -48,5 +48,11 @@ public Identifier GetIdentifierByCode(string code)
{
return mgr.GetIdentifierByCode(code);
}

public Identifier GetIdentifierByName(string name)

{
return mgr.GetIdentifierByName(name);
}
}
}
1 change: 1 addition & 0 deletions IQCare.CCC/IQCare.CCC.UILogic/IQCare.CCC.UILogic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
<Compile Include="PersonMaritalStatusManager.cs" />
<Compile Include="PersonOvcStatusManager.cs" />
<Compile Include="PersonRelationshipManager.cs" />
<Compile Include="PharmacyHistoryDrugSubstitutionsManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PatientLabOrderManager.cs" />
<Compile Include="Screening\PatientScreeningManager.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using Application.Presentation;
using Interface.CCC.ClinicalSummary;

namespace IQCare.CCC.UILogic
{
public class PharmacyHistoryDrugSubstitutionsManager
{
IPharmacyHistoryDrugSubstitutionsSwitches _mgr = (IPharmacyHistoryDrugSubstitutionsSwitches)ObjectFactory.CreateInstance("BusinessProcess.CCC.ClinicalSummary.BPharmacyHistoryDrugSubstitutionsSwitches, BusinessProcess.CCC");

public List<PharmacyHistory> GetPharmacyDrugsSubstitutionsSwitchesData(int ptn_pk)
{
try
{
return _mgr.GetPharmacyDrugsSubstitutionsSwitchesData(ptn_pk);
}
catch (Exception ex)
{
throw ex;
}
}
}
}
99 changes: 87 additions & 12 deletions IQCare.CCC/IQCare.Web.CCC/CCC/OneTimeEvents/FamilyTesting.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<label class="control-label pull-left">Age(Years)</label>
</div>
<div class="col-md-6">
<asp:TextBox ID="personAge" runat="server" ClientIDMode="Static" CssClass="form-control input-sm" placeholder="0"></asp:TextBox>
<asp:TextBox ID="personAge" runat="server" ClientIDMode="Static" CssClass="form-control input-sm" onkeypress="return isNumberKey(event)" placeholder="0"></asp:TextBox>
<asp:HiddenField ID="dobPrecision" runat="server" ClientIDMode="Static" />
</div>
</div>
Expand All @@ -114,7 +114,7 @@
<label class="control-label pull-left">Age(Months)</label>
</div>
<div class="col-md-6">
<asp:TextBox ID="personMonth" runat="server" ClientIDMode="Static" CssClass="form-control input-sm" placeholder="0" min="0"></asp:TextBox>
<asp:TextBox ID="personMonth" runat="server" ClientIDMode="Static" CssClass="form-control input-sm" placeholder="0" min="0"></asp:TextBox>

</div>
</div>
Expand Down Expand Up @@ -438,7 +438,7 @@
<label class="control-label pull-left">Age(Years)</label>
</div>
<div class="col-md-6">
<asp:TextBox ID="TextBox2" runat="server" ClientIDMode="Static" CssClass="form-control input-sm" placeholder="0" required="true" min="0"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" ClientIDMode="Static" CssClass="form-control input-sm" placeholder="0" required="true" min="0"></asp:TextBox>
</div>
</div>

Expand Down Expand Up @@ -779,12 +779,40 @@
momentConfig: { culture: 'en', format: 'DD-MMM-YYYY' }
});
$("#personAge").keyup(function () {
$("#personMonth").keyup(function () {
var personAge = parseInt($("#personAge").val());
personAge = (isNaN(personAge)) ? 0 : personAge;
var personMonth = parseInt($("#personMonth").val());
if (personMonth < 0) {
$("#personMonth").val("");
toastr.error("Patient's Month should be more than zero", "Person Month");
return false;
personMonth.val("");
}
if (personAge != null && personAge != "" && (personAge > 0 || personAge <= 120))
{
personAge = personAge;
}
if (personAge == null || personAge == "" || personAge <= 0 || personAge ==undefined) {
personAge= 0
}
if (personMonth >= 0) {
$('#Dob').val(estimateDob(personAge, personMonth ));
}
});
$("#personAge").keyup(function () {
var personAge = parseInt($("#personAge").val());
var personMonth = parseInt($("#personMonth").val());
personMonth = (isNaN(personMonth)) ? 0 : personMonth;
if (personAge <= 0) {
$("#Dob").val("");
toastr.error("Patient's Age should not be zero", "Person Age");
toastr.error("Patient's Age should not be zero or less than zero", "Person Age");
return false;
} else if (personAge > 120) {
$("#Dob").val("");
Expand All @@ -793,7 +821,15 @@
}
if (personAge != null && personAge != "" && (personAge > 0 || personAge <= 120)) {
$('#Dob').val(estimateDob(personAge));
if (personMonth >= 0 ) {
personMonth = personMonth;
}
else {
personMonth = 0;
}
$('#Dob').val(estimateDob(personAge, personMonth));
}
$("#dobPrecision").val("false");
Expand Down Expand Up @@ -861,6 +897,16 @@
});
return result;
}
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode;
var num = document.getElementById('someid').value;
if ((charCode > 31 && (charCode < 48 || charCode > 57)) || (num > 10)){
return false;
}else{
return true;
}
}
function GetPatientBaselineandResult(personId, patientId) {
Expand Down Expand Up @@ -935,6 +981,7 @@
}
if (!(LastName == null || LastName == 'undefined' || LastName == "")) {
$("#<%=LastName.ClientID%>").val(LastName);
}
Expand Down Expand Up @@ -1086,6 +1133,7 @@
var previousDate = moment().subtract(1, 'days').format('DD-MMM-YYYY');
var adult = moment().subtract(10, 'years').format('DD-MMM-YYYY');
var cccReferalDate = $("#CCCReferalDate").val();
if (dob !== "") {
var today = new Date();
Expand Down Expand Up @@ -1197,6 +1245,22 @@
}
}
}
if (age > patientAge && (($("#Relationship :selected").text() === "Child"))) {
toastr.error("A child cannot be older than the parent");
return false;
}
if (patientAge > age && (($("#Relationship :selected").text() === "Father"))) {
toastr.error("Patient cannot be older than Father");
return false;
}
if (patientAge> age && (($("#Relationship :selected").text() === "Mother"))) {
toastr.error("Patient cannot be older than Mother");
return false;
}
if (moment('' + baselineHivStatusDate + '').isAfter(hivTestingresultDate)) {
toastr.error("Baseline HIV status date cannot be greater than HIV testing result date.");
return false;
Expand Down Expand Up @@ -1433,7 +1497,7 @@
'<td style="text-align: left">' + baselineDate + '</td>' +
'<td style="text-align: left">' + item.HivStatusResult + '</td>' +
'<td style="text-align: left">' + testingDate + '</td>' +
'<td style="text-align: left">' + referred + "</td>" +
'<td style="text-align: left">' + referred + "</td>" +
'<td style="text-align: left">' + linkageDate + "</td>" +
'<td style="text-align: left">' + action + '</td>' +
'<td align="right">' + enrollment + '</td></tr>';
Expand Down Expand Up @@ -1603,9 +1667,12 @@
var previousDate = moment().subtract(1, 'days').format('DD-MMM-YYYY');
var adult = moment().subtract(15, 'years').format('DD-MMM-YYYY');
var cccReferalModDate = $("#CccReferalModDDate").val();
//console.log(CccReferalModDate);
////validations
//return false;
if (hivTestingresultText == "Never Tested") {
toastr.error("Never Tested should not be a follow up test result");
Expand Down Expand Up @@ -1653,6 +1720,8 @@
toastr.error("A child cannot have a spouse.");
return false;
}
if (patientAge < 16 && (($("#Relationship :selected").text() === "Partner"))) {
$("#Relationship").val(0);
toastr.error("A child cannot have a partner.");
Expand All @@ -1663,6 +1732,7 @@
toastr.error("A child cannot have a child.");
return false;
}
else {
$.ajax({
type: "POST",
Expand Down Expand Up @@ -1995,15 +2065,17 @@
}
}
function estimateDob(personAge) {
function estimateDob(personAge,personMonth) {
var currentDate = new Date();
currentDate.setDate(15);
currentDate.setMonth(5);
//currentDate.setDate(15);
//currentDate.setMonth(5);
console.log(currentDate);
var estDob = moment(currentDate.toISOString());
var dob = estDob.add((personAge * -1), 'years');
//var estDob = moment(currentDate.toISOString());
//var dob = estDob.add((personAge * -1), 'years').subtract(personMonth, 'months');
var dob=moment().subtract(personAge,'years').subtract(personMonth, 'months');
return moment(dob).format('DD-MMM-YYYY');
}
function getAge(dateString) {
var today = new Date();
Expand All @@ -2013,6 +2085,9 @@
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
if (m < 0) {
m = 12 - (-m + 1);
}
$("#personMonth").val(m);
return age;
Expand Down
Loading

0 comments on commit 0f02853

Please sign in to comment.