Example #1
0
    // gather the patient, appointment, location, and where to attach the chart:
    static public void Main()
    {
        string practiceID         = "{practiceid}";
        string athenaPatientID    = "{patientid}";
        string athenaApptID       = "{appointmentid}";
        string athenaDepartmentID = "{departmentid}";
        bool   attachPDFToVisit   = false; // true/false if true, attach to appointment, otherwise attach to patient chart

        string internalNote = "This note seems to be the document name that the user sees";

        // put the pdf into a byte array
        byte[] data;
        string path = "/path/to/pdf-sample.pdf";

        data = File.ReadAllBytes(path);

        PDFSend sender = new PDFSend();
        string  reply  = sender.SendPDFToAthena(practiceID, athenaPatientID, athenaApptID, athenaDepartmentID, internalNote, attachPDFToVisit, data);

        AthenaDocumentResponse resp = new AthenaDocumentResponse();

        resp = resp.GetResponse(reply);
        if (resp.error != null)
        {
            // error handling here; resp.error gives the detailed message
            Console.WriteLine(resp.error);
        }
        else
        {
            // handle success here: resp.documentid give the athena doc id.  Save or ignore
            Console.WriteLine(reply); // this is just the full json response
        }
    }
Example #2
0
    public AthenaDocumentResponse GetResponse(string jsonAsString)
    {
        AthenaDocumentResponse resp = new AthenaDocumentResponse();

        resp = JsonConvert.DeserializeObject <AthenaDocumentResponse>(jsonAsString);
        return(resp);
    }