//Creates a standard, more detailed card private dynamic standardPatientCardCreator(PatientModel patient) { cardCreator creator = new cardCreator(); AdaptiveCard card = new AdaptiveCard(); card.Body.Add(creator.createTitle("Patient Record")); //Create two columns; puts an image in the first one, leaves the other empty (image is intended as a user icon) AdaptiveColumnSet profileContainer = creator.createPhotoTextColumnSection( "https://www.kindpng.com/picc/m/495-4952535_create-digital-profile-icon-blue-user-profile-icon.png", 90); //Adds the user's name at the top profileContainer.Columns[1].Items.Add(new AdaptiveTextBlock() { Text = getPatientName(patient), Size = AdaptiveTextSize.Medium, Weight = AdaptiveTextWeight.Bolder }); //Profile Section (gender, DOB, Deceased Date) string[] profileHeadings = { "Gender: ", "Date of Birth: ", "Deceased Date: " }; string[] profile = { patient.Gender, patient.BirthDate.ToString("dd/MM/yyyy"), patient.DeceasedDateTime == DateTimeOffset.MinValue ? "N/A" : patient.DeceasedDateTime.ToString("dd/MM/yyyy") }; profileContainer.Columns[1].Items.Add(creator.createDualTextColumnSection(profileHeadings, profile)); card.Body.Add(profileContainer); //Personal Information Section string[] personal = { patient.MaritalStatus.Text, separatedLanguageString(patient.Communication, ",") }; string[] personalFields = { "Marital Status:", "Languages:" }; card.Body.Add(creator.createSection("Personal Information", personalFields, personal)); //Medical Section string[] medicalFields = { "Medical Practice:", "General Practitioner:" }; string[] medical = { patient.gpOrganization ?? "N/A", patient.assignedGP ?? "N/A" }; card.Body.Add(creator.createSection("Medical Information", medicalFields, medical)); //Address Section string[] address = { listToDelimitedString(patient.Address[0].Line, ","), patient.Address[0].City, patient.Address[0].State, patient.Address[0].Country }; card.Body.Add(creator.createSection("Address", address)); //Contact Section string[] contactFields = { patient.Telecom[0].System + ":", "Use:" }; string[] contacts = { patient.Telecom[0].Value, patient.Telecom[0].Use }; card.Body.Add(creator.createSection("Contact Details", contactFields, contacts)); return(JsonConvert.DeserializeObject(card.ToJson())); }
private dynamic singleObservationCardCreator(string date, string type, string value, string unit) { cardCreator creator = new cardCreator(); AdaptiveCard card = new AdaptiveCard(); DateTime dateFormatted = DateTime.ParseExact(date, "yyyyMMdd", null); card.Body.Add(creator.createTitle(type)); card.Body.Add(creator.createSection("Observation Taken on " + dateFormatted.ToString("dd/MM/yyyy"), new string[] { type }, new string[] { value + " " + unit })); return(JsonConvert.DeserializeObject(card.ToJson())); }