private DsioChecklistItem GetDsioChecklistItem(ChecklistItem item) { DsioChecklistItem returnVal = new DsioChecklistItem() { Ien = item.Ien, Category = item.Category, Description = item.Description, Link = item.Link, DueCalculationType = item.DueCalculationType, ItemType = item.ItemType, EducationIen = item.EducationItemIen }; returnVal.DueCalculationValue = item.DueCalculationValue.ToString(); return(returnVal); }
public IenResult SavePregnancyItem(PregnancyChecklistItem item) { IenResult result = new IenResult(); if (this.broker != null) { DsioSaveMccPatChecklistCommand command = new DsioSaveMccPatChecklistCommand(broker); DsioChecklistItem dsioItem = GetDsioChecklistItem(item); DsioPatientChecklistItem patItem = new DsioPatientChecklistItem(dsioItem); patItem.PatientDfn = item.PatientDfn; patItem.PregnancyIen = item.PregnancyIen; if (item.SpecificDueDate != DateTime.MinValue) { patItem.SpecificDueDate = Util.GetFileManDate(item.SpecificDueDate); } patItem.CompletionStatus = item.CompletionStatus; patItem.CompleteDate = Util.GetFileManDate(item.CompleteDate); patItem.CompletionLink = item.CompletionLink; patItem.CompletedBy = item.CompletedBy; patItem.Note = item.StoredNote; patItem.InProgress = (item.InProgress) ? "1" : "0"; // *** These items not saved - generated internally *** //patItem.User = item.User; //patItem.ItemDate = Util.GetFileManDate(item.ItemDate); command.AddCommandArguments(patItem); RpcResponse response = command.Execute(); result.SetResult(response.Status == RpcResponseStatus.Success, response.InformationalMessage); if (result.Success) { result.Ien = command.Ien; } } return(result); }
public void TestDeleteChecklistItem() { using (RpcBroker broker = this.GetConnectedBroker()) { // TODO: Make sure testing with non programmer user.. this.SignonToBroker(broker, 2); //this.SignonToBroker(broker, 0); DsioSaveMccChecklistCommand saveCommand = new DsioSaveMccChecklistCommand(broker); DsioChecklistItem item = new DsioChecklistItem() { Ien = "", Description = "Send Link to Pregnancy Video", ItemType = DsioChecklistItemType.EducationItem, DueCalculationType = DsioChecklistCalculationType.WeeksGa, DueCalculationValue = "12", Category = "Some New Category", Link = "3456" }; saveCommand.AddCommandArguments(item); RpcResponse response = saveCommand.Execute(); Assert.AreEqual(RpcResponseStatus.Success, response.Status); Assert.IsFalse(string.IsNullOrWhiteSpace(saveCommand.Ien)); DsioDeleteMccChecklistCommand delCommand = new DsioDeleteMccChecklistCommand(broker); delCommand.AddCommandArguments(saveCommand.Ien); response = delCommand.Execute(); Assert.AreEqual(RpcResponseStatus.Success, response.Status); } }
public IenResult SaveItem(ChecklistItem item) { IenResult result = new IenResult(); if (this.broker != null) { DsioSaveMccChecklistCommand command = new DsioSaveMccChecklistCommand(this.broker); DsioChecklistItem dsioItem = GetDsioChecklistItem(item); command.AddCommandArguments(dsioItem); RpcResponse response = command.Execute(); result.SetResult(response.Status == RpcResponseStatus.Success, response.InformationalMessage); if (result.Success) { result.Ien = command.Ien; } } return(result); }
private ChecklistItem GetChecklistItem(DsioChecklistItem dsioItem) { ChecklistItem returnVal = new ChecklistItem() { Ien = dsioItem.Ien, Category = dsioItem.Category, Description = dsioItem.Description, Link = dsioItem.Link, EducationItemIen = dsioItem.EducationIen }; int calcVal = -1; if (int.TryParse(dsioItem.DueCalculationValue, out calcVal)) { returnVal.DueCalculationValue = calcVal; } returnVal.ItemType = dsioItem.ItemType; //GetChecklistItemType(dsioItem.ItemType); returnVal.DueCalculationType = dsioItem.DueCalculationType; //GetDueCalculationType(dsioItem.DueCalculationType); return(returnVal); }