Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTC-433: Fix DSI rest API endpoints to allow null as last_update_date #114

Merged
merged 1 commit into from Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenImis.ModulesV3/ClaimModule/Models/DsiInputModel.cs
Expand Up @@ -13,6 +13,6 @@ namespace OpenImis.ModulesV3.ClaimModule.Models
public class DsiInputModel
{
[JsonConverter(typeof(IsoDateOnlyDatetimeSerializer))]
public DateTime last_update_date { get; set; }
public DateTime? last_update_date { get; set; }
}
}
Expand Up @@ -10,6 +10,6 @@ public class PaymentListsInputModel
[Required]
public string claim_administrator_code { get; set; }
//[ValidDate]
public DateTime last_update_date { get; set; }
public DateTime? last_update_date { get; set; }
}
}
10 changes: 5 additions & 5 deletions OpenImis.ModulesV3/ClaimModule/Repositories/ClaimRepository.cs
Expand Up @@ -151,7 +151,7 @@ public DiagnosisServiceItem GetDsi(DsiInputModel model)
List<CodeNamePrice> services;

diagnoses = imisContext.TblIcdcodes
.Where(i => i.ValidityFrom >= Convert.ToDateTime(model.last_update_date)
.Where(i => (model.last_update_date == null || i.ValidityFrom >= model.last_update_date)
&& i.ValidityTo == null)
.Select(x => new CodeName()
{
Expand All @@ -160,7 +160,7 @@ public DiagnosisServiceItem GetDsi(DsiInputModel model)
}).ToList();

items = imisContext.TblItems
.Where(i => i.ValidityFrom >= Convert.ToDateTime(model.last_update_date)
.Where(i => (model.last_update_date == null || i.ValidityFrom >= model.last_update_date)
&& i.ValidityTo == null)
.Select(x => new CodeNamePrice()
{
Expand All @@ -170,7 +170,7 @@ public DiagnosisServiceItem GetDsi(DsiInputModel model)
}).ToList();

services = imisContext.TblServices
.Where(i => i.ValidityFrom >= Convert.ToDateTime(model.last_update_date)
.Where(i => (model.last_update_date == null || i.ValidityFrom >= model.last_update_date)
&& i.ValidityTo == null)
.Select(x => new CodeNamePrice()
{
Expand Down Expand Up @@ -290,7 +290,7 @@ public PaymentLists GetPaymentLists(PaymentListsInputModel model)
.Where(r => r.TblItems.ValidityTo == null)
.Where(r => r.TblPlitemsDetail.PlitemId == PLItemID
&& r.TblPlitemsDetail.ValidityTo == null
&& (r.TblPlitemsDetail.ValidityFrom >= model.last_update_date || model.last_update_date == null))
&& (model.last_update_date == null || r.TblPlitemsDetail.ValidityFrom >= model.last_update_date))
.Select(x => new CodeNamePrice()
{
code = x.TblItems.ItemCode,
Expand All @@ -306,7 +306,7 @@ public PaymentLists GetPaymentLists(PaymentListsInputModel model)
.Where(r => r.TblServices.ValidityTo == null)
.Where(r => r.TblPlservicesDetail.PlserviceId == PLServiceID
&& r.TblPlservicesDetail.ValidityTo == null
&& (r.TblPlservicesDetail.ValidityFrom >= model.last_update_date || model.last_update_date == null))
&& (model.last_update_date == null || r.TblPlservicesDetail.ValidityFrom >= model.last_update_date))
.Select(x => new CodeNamePrice()
{
code = x.TblServices.ServCode,
Expand Down