public TaggedProstheticClaimArray getProstheticClaims(string dfn, string episodeDates) { TaggedProstheticClaimArray result = new TaggedProstheticClaimArray(); if (!mySession.ConnectionSet.IsAuthorized) { result.fault = new FaultTO("Connections not ready for operation", "Need to login?"); } if (result.fault != null) { return(result); } string[] dates = episodeDates.Split(new char[] { ',' }); List <string> dateList = new List <string>(dates.Length); for (int i = 0; i < dates.Length; i++) { if (!dateList.Contains(dates[i])) { dateList.Add(dates[i]); } } try { List <ProstheticClaim> claims = ProstheticClaim.getProstheticClaims(mySession.ConnectionSet.BaseConnection, dfn, dateList); result = new TaggedProstheticClaimArray(mySession.ConnectionSet.BaseConnection.DataSource.SiteId.Id, claims); } catch (Exception e) { result.fault = new FaultTO(e); } return(result); }
public TaggedProstheticClaimArray(string tag, ProstheticClaim mdo) { this.tag = tag; if (mdo == null) { this.count = 0; return; } this.claims = new ProstheticClaimTO[1]; this.claims[0] = new ProstheticClaimTO(mdo); this.count = 1; }
internal ProstheticClaim[] toProstheticClaims(string[] response) { if (response == null || response.Length == 0) { return(null); } List <ProstheticClaim> lst = new List <ProstheticClaim>(response.Length); for (int i = 0; i < response.Length; i++) { if (response[i] == "") { continue; } response[i] = response[i].Replace("^", "^"); string[] flds = response[i].Split(new char[] { '^' }); if (flds.Length == 0) { continue; } ProstheticClaim claim = new ProstheticClaim(); claim.Id = flds[0]; if (flds.Length > 1) { claim.PatientId = flds[1]; } if (flds.Length > 2) { claim.PatientName = flds[2]; } if (flds.Length > 3) { claim.EpisodeDate = VistaTimestamp.toUtcString(flds[3]); } if (flds.Length > 4) { claim.ItemId = flds[4]; } if (flds.Length > 5) { claim.Timestamp = VistaTimestamp.toUtcString(flds[5]); } if (flds.Length > 6) { claim.LastEditTimestamp = VistaTimestamp.toUtcString(flds[6]); } lst.Add(claim); } return((ProstheticClaim[])lst.ToArray()); }
internal void addMoreProstheticClaimData(ProstheticClaim claim) { if (!hasMoreProstheticClaimData(claim.ItemId)) { return; } string arg = "$P($G(^RMPR(660," + claim.ItemId + ",1)),U,4)" + "_U_" + "$P($G(^RMPR(660," + claim.ItemId + ",0)),U,16)" + "_U_" + "$P($G(^RMPR(660," + claim.ItemId + ",10)),U,9)"; string response = VistaUtils.getVariableValue(cxn, arg); string[] flds = response.Split(new char[] { '^' }); claim.Cost = flds[1]; claim.ConsultId = flds[2]; arg = "$P($G(^RMPR(661.1," + flds[0] + ",0)),U,2)"; response = VistaUtils.getVariableValue(cxn, arg); claim.ItemName = response; }
// This is for iterating thru a list of patients at one site, getting the prosthetics from only that site. public TaggedProstheticClaimArray getProstheticClaimsForPatient(string dfn) { TaggedProstheticClaimArray result = new TaggedProstheticClaimArray(); if (!mySession.ConnectionSet.IsAuthorized) { result.fault = new FaultTO("Connections not ready for operation", "Need to login?"); } if (result.fault != null) { return(result); } try { ProstheticClaim[] claims = ProstheticClaim.getProstheticClaimsForPatient(mySession.ConnectionSet.BaseConnection, dfn); result = new TaggedProstheticClaimArray(mySession.ConnectionSet.BaseConnection.DataSource.SiteId.Id, claims); } catch (Exception e) { result.fault = new FaultTO(e); } return(result); }
public ProstheticClaimTO(ProstheticClaim mdo) : base(mdo) { this.prostheticId = mdo.ItemId; this.prostheticName = mdo.ItemName; }
internal ProstheticClaim[] toProstheticClaims(string[] response) { if (response == null || response.Length == 0) { return null; } List<ProstheticClaim> lst = new List<ProstheticClaim>(response.Length); for (int i = 0; i < response.Length; i++) { if (response[i] == "") { continue; } response[i] = response[i].Replace("^", "^"); string[] flds = response[i].Split(new char[] { '^' }); if (flds.Length == 0) { continue; } ProstheticClaim claim = new ProstheticClaim(); claim.Id = flds[0]; if (flds.Length > 1) { claim.PatientId = flds[1]; } if (flds.Length > 2) { claim.PatientName = flds[2]; } if (flds.Length > 3) { claim.EpisodeDate = VistaTimestamp.toUtcString(flds[3]); } if (flds.Length > 4) { claim.ItemId = flds[4]; } if (flds.Length > 5) { claim.Timestamp = VistaTimestamp.toUtcString(flds[5]); } if (flds.Length > 6) { claim.LastEditTimestamp = VistaTimestamp.toUtcString(flds[6]); } lst.Add(claim); } return (ProstheticClaim[])lst.ToArray(); }