I’m creating a new patient in my test system. I have extracted the text using search rectangles to read the text and log the output. Since I’m putting a random number generator at the end of the patients name, I’m needing to dynamically read the patient name (+the random characters) and then write that to a json file.
I have the patient name nested under Patient Info. I can read from here but I’m trying to write the newly captured patient name. Also, would be beneficial if we could remove the existing or create a copy of the json file and replace the existing with the new info. I think that’s how we would have to go about this. Any insights on the syntax in how to write to a json file would be appreciated.
Here’s what I tried after extracting the patient name and putting it into variable but neither write/nor put worked for me. Thanks.
Set DataFile To JSONValue(File ResourcePath(“PatientCreate.json”))
Write Patient To JSONFormat(DataFile.PatientCreate.PatientInfo.Name)
Put JSONFormat(Patient) Into (DataFile.PatientCreate.PatientInfo.Name)
Zechariah Williams is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.