Regex pattern for numberss

hi i have a pdf … if i use read pdf text activity … im getting this as output …

@"3155 W. Craig Road,
Suites 120,
130 & 140,
North
Phone: 702-639-2333
Fax: 702-639-2334
Medicaid IniƟal EvaluaƟon/Plan of Care -
12/19/2023
Name: Moore,
Kingdom Y (24357969) Physician: Self MD,
Referral
DOB: 6/24/2016 Age: 7 Sex: M
Date of Injury: 12/1/2023
Primary/Rehab Diagnosis: Brachial Plexopathy
ICD10 Codes: G54.0

Assessment:
TEST
Primary Complaint: TEST Nature of Injury: TEST
Current Level of FuncƟon: PaƟent reports limitaƟons with Bathing,
Caring for family member,
Carrying
Prior Level of FuncƟon: Unlimited with all acƟviƟes
Pain Scale:
SigniĮcant Findings:
ObservaƟons:
ObservaƟon Comment: TEST
BMI: PaƟent not eligible for medical reasons
Plan of Treatment: 2x a week for 2 weeks
Treatments: 97110 TherapeuƟc exercises ,
97140 Manual therapy ,
97112 Neuromuscular re-educaƟon ,
97530 TherapeuƟc acƟviƟes ,
97161-97163 PT EvaluaƟon
These treatments will address the objecƟve and funcƟonal deĮcits as deĮned above
The paƟent will be advanced safely and appropriately in order for the paƟent to progress towards his / her prior level of funcƟon. AddiƟonal exercises will be introduced,
with progression to a
comprehensive home exercise program upon discharge,
to ensure carry over of funcƟonal gains achieved in the clinic. This treatment plan has been reviewed and agreed upon by the paƟent.
Goals:
Long Term Goals to be completed by: 01/03/2024

  1. PaƟent will decrease pain score to TEST/10 to allow for compleƟon of:
    Bathing
  2. PaƟent will increase ROM to TEST in order to allow for compleƟon of:
    Caring for family member
  3. PaƟent will increase strength to TEST in order to allow for compleƟon of:
    Carrying

Electronically Signed By: Gowthamraj Manibalan,
PT,
License 0 December 20,
2023 1:01 PM

To Be Completed by Physician

I cerƟfy the need for these services furnished under this plan of treatment and while under my care.

Revise plan of care as follows:

Physician: Self MD,
Referral Physician Signature: Date:"

i want ouptut as the -

Treatments: 97110 TherapeuƟc exercises ,
97140 Manual therapy ,
97112 Neuromuscular re-educaƟon ,
97530 TherapeuƟc acƟviƟes ,
97161-97163 PT EvaluaƟon

only those number not words with commas … using regex

can u please create a xaml and give it to me … it is useful for me

Hi @Nikhil_Katta

(Treatments:[\s\S]*?\d+\-.*)

Use this below in Assign activity
System.Text.RegularExpressions.Regex.Match(Input,"(Treatments:[\s\S]*?\d+\-.*)").Value

Cheers!!

Hi @Nikhil_Katta

Try the following:

Input= "3155 W. Craig Road,
Suites 120,
130 & 140,
North
Phone: 702-639-2333
Fax: 702-639-2334
Medicaid IniƟal EvaluaƟon/Plan of Care -
12/19/2023
Name: Moore,
Kingdom Y (24357969) Physician: Self MD,
Referral
DOB: 6/24/2016 Age: 7 Sex: M
Date of Injury: 12/1/2023
Primary/Rehab Diagnosis: Brachial Plexopathy
ICD10 Codes: G54.0

Assessment:
TEST
Primary Complaint: TEST Nature of Injury: TEST
Current Level of FuncƟon: PaƟent reports limitaƟons with Bathing,
Caring for family member,
Carrying
Prior Level of FuncƟon: Unlimited with all acƟviƟes
Pain Scale:
SigniĮcant Findings:
ObservaƟons:
ObservaƟon Comment: TEST
BMI: PaƟent not eligible for medical reasons
Plan of Treatment: 2x a week for 2 weeks
Treatments: 97110 TherapeuƟc exercises ,
97140 Manual therapy ,
97112 Neuromuscular re-educaƟon ,
97530 TherapeuƟc acƟviƟes ,
97161-97163 PT EvaluaƟon
These treatments will address the objecƟve and funcƟonal deĮcits as deĮned above
The paƟent will be advanced safely and appropriately in order for the paƟent to progress towards his / her prior level of funcƟon. AddiƟonal exercises will be introduced,
with progression to a
comprehensive home exercise program upon discharge,
to ensure carry over of funcƟonal gains achieved in the clinic. This treatment plan has been reviewed and agreed upon by the paƟent.
Goals:
Long Term Goals to be completed by: 01/03/2024

PaƟent will decrease pain score to TEST/10 to allow for compleƟon of:
Bathing
PaƟent will increase ROM to TEST in order to allow for compleƟon of:
Caring for family member
PaƟent will increase strength to TEST in order to allow for compleƟon of:
Carrying
Electronically Signed By: Gowthamraj Manibalan,
PT,
License 0 December 20,
2023 1:01 PM

To Be Completed by Physician

I cerƟfy the need for these services furnished under this plan of treatment and while under my care.

Revise plan of care as follows:

Physician: Self MD,
Referral Physician Signature: Date:"

Output= System.Text.RegularExpressions.Regex.Match(Input,"(Treatments)[\s\S]*\d+\-\d+\s+[A-Z]+\s+[A-Za-zƟ]*").Value

Check the below image for better understanding:

Sequence10.xaml (7.1 KB)

Hope it helps!!
Regards

@Nikhil_Katta
if you need only numbers in the given output???

arry_str=System.Text.RegularExpressions.Regex.Matches(pdf_output.Split({“Treatments:”},StringSplitOptions.RemoveEmptyEntries)(1),“[0-9]{5}”)

Cheers!!

but sometimes the number may increase or decrease … but it will start the keyword as “Treatments…”

and also i want only numbers not the letters

examples : 97110 , 97140 ,97112, 97530 , continue if any number is there

@Nikhil_Katta

Can you try the below flow

LineItem = System.Text.RegularExpressions.Regex.Match(Input,"(Treatments:[\s\S]*?\d+\-.*)").Value

Output = System.Text.RegularExpressions.Regex.Matches(LineItem.ToString,"(\d+\-?\d+)")

Main 1.xaml (21.4 KB)

Cheers!!

yes this is ok … but how can i get all the codes in one variable and i can pass that variable …
can u please that also

@Nikhil_Katta

If you want to join with new line try below

String.Join(Environment.NewLine,Output)

If you want to join with , try below

String.Join(“,”,Output)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.