Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Action Button to generate "Notes" in a Text field with dynamic formatting

Engaged ,
Dec 19, 2016 Dec 19, 2016

I am making a medical form in which i have text fields which generates notes based upon the form fields selection.

Dropbox - ScreenCapture_12.flv

First of you plz see the video from the above link.... i am getting everything right.. except for the problem in the video....the problem is .... when one doesnot choose the continous check boxes there is a one line gap between the two options (plz refer the above video link)............I want that when any of the checkbox is checked the there should not be a  line gap.. as is the case in the video.

Below is the java script which i am using:

this.getField("subjective").value = "SOAP Notes\n" + "\n"+ "Chief Complaint\n" + "\n" + "Mr. " + this.getField("member.name.last").value + " is inquiring about utilizing orthotic bracing for his current conditions. His chief complaint at the time of this assessment is: " + this.getField("consult.chief-complaint").value + "\n\n" + "Subjective Notes - Information Reported by Patient\n\n" + "On a 0-10 pain scale" + "; " +  "the patient describes his pain as being at a level "  + this.getField("dme.pain-level").value + ". " + this.getField("location").value + " pain has been constant for " + this.getField("dme.length-of-pain").value + " months.\n\n" + "Mr. " + this.getField("member.name.last").value + " chief complaint is " + this.getField("area.pain").value + " pain, which he reports is associated with a level " + this.getField("dme.pain-scale").value + " pain on the 1 to 10 severity scale. The patient also says that " + this.getField("blankfield").value + " aggravates the condition" + "," + " temporarily resulting in higher pain levels on the severity scale.\n" +  "\n"+ this.getField("member.name.first").value + " has indicated that his back pain makes it difficult to walk.\n\n" +

"Objective Notes from Treating Physician\n\n" + "My consultation with " + this.getField("salutation").value + " " + this.getField("member.name.last").value + " today, a/an " + this.getField("member.age").value + " years old, " + this.getField("member.gender").value

+ " was in regard to his complaint of " + this.getField("location").value + " pain. " + "This a " + this.getField("dme.pain-level").value + " level " + this.getField("dme.pain-scale").value + " pain, but is made even worse when aggravated by " + this.getField("dme.worsen-pain").value + "." + " I consider this to be caused by general weakness, due to a pre-existing condition resulting in the current level of pain and discomfort for an extended time.\n\n" + "Assessment Notes\n\n" + this.getField("Text1").value + "\n" + this.getField("Text2").value + "\n" + this.getField("Text3").value

The above in red text are the check box values which should be listed without space .. irrespective of the selection of any options.. continuous or non-continuous

TOPICS
Acrobat SDK and JavaScript , Windows
4.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Dec 20, 2016 Dec 20, 2016

Yes , this is your script....

You should use something like this:

var txt = "";

if (this.getField("Text2").value != "") txt = "\n" + this.getField("Text2").value;

Then add txt to your subject.

Translate
Engaged ,
Dec 20, 2016 Dec 20, 2016

Here is the link to the working file...... Please see the 2nd page .. "Generate Notes" button for the required javascript

https://www.dropbox.com/s/poqjd5liowk9m6w/Common%20OrthoticRaw%20file.pdf?dl=0

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2016 Dec 21, 2016

Like this:

var txt = "";

if (this.getField("Text2").value != "") txt = "\n" + this.getField("Text2").value;

this.getField("subjective").value = "SOAP Notes..." + "... Notes\n\n" + this.getField("Text1").value + txt + "\n" + this.getField("Text3").value;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2016 Dec 21, 2016

there are not only 3 checkboxes  ... there are "n" number of checkboxes... how to cope up with that.......

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2016 Dec 21, 2016

You can use txt1, txt2, and so on.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2016 Dec 21, 2016

Thank you sir,,...... it works....... thank you very much......

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 10, 2017 May 10, 2017
LATEST

Please see the following thread:

https://forums.adobe.com/message/9506221#950622

I have a two fields Text3 in which user inputs the any date.... and Text4 in which by default it should be Text 3  + 30 days....... but if users want to change the date in Text4 they can do so but within the range of Text 3  + 45 days. 

I have put the following script in the calculation tab of the Text4 field:

var sDate = this.getField("Text3").value; // get date string

var oDate = util.scand("mm/dd/yyyy", sDate); // convert to object

var nDay = 1000 * 60 * 60 * 24; // define 1 day in milliseconds

var nDate = oDate.getTime() + (30 * nDay); // add 7 days as milliseconds

oDate = new Date(nDate); // convert milliseconds to date object

defau= util.printd("mm/dd/yyyy", oDate); // format result

var endDate = this.getField("Text3").value; // get date string

var pDate = util.scand("mm/dd/yyyy", endDate); // convert to object

var eDay = 1000 * 60 * 60 * 24; // define 1 day in milliseconds

var eDate = pDate.getTime() + (45 * eDay); // add 7 days as milliseconds

pDate = new Date(eDate); // convert milliseconds to date object

end= util.printd("mm/dd/yyyy", pDate); // format result

var startDate = this.getField("Text3").value; // get date string

stDate = util.scand("mm/dd/yyyy", startDate); // convert to object

var currentField = this.getField("Text4").value;

eventDate = util.scand("mm/dd/yyyy", currentField); // convert to object

if (stDate <= eventDate && eventDate <= end) {event.value = event.value}

else { event.value = ""}

But the output is always the "defau"    ....... even if it input the correct range value in Text4.

Plz guide..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines