Hi,
I am using a claims dataset in order to identify procedures performed during inpatient admission. The dataset has both professional claims and facility claims. In order to prevent duplicate counting of claims, I am trying to first identify the professional claims and then only identify the facility claims if the patient does not have a professional claim for that admission date. I used a loop to create a variable (ercp_is) that identified professional claims based on a CPT code. I now want to replace the "0" values for a "1" if a professional claim was identified for that admission date. This would allow me to only create a facility claim if no professional claim exists for that patient on that admission date.
An example of my data is shown below.
. dataex id ercp_is admdate in 18301/18312
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
I am struggling trying to figure out how to replace these values. Thank you in advance for help.
I am using a claims dataset in order to identify procedures performed during inpatient admission. The dataset has both professional claims and facility claims. In order to prevent duplicate counting of claims, I am trying to first identify the professional claims and then only identify the facility claims if the patient does not have a professional claim for that admission date. I used a loop to create a variable (ercp_is) that identified professional claims based on a CPT code. I now want to replace the "0" values for a "1" if a professional claim was identified for that admission date. This would allow me to only create a facility claim if no professional claim exists for that patient on that admission date.
An example of my data is shown below.
. dataex id ercp_is admdate in 18301/18312
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(id ercp_is) str9 admdate 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 0 "14-AUG-19" 3842505 1 "14-AUG-19" 3842505 1 "14-AUG-19" 3842505 1 "14-AUG-19" end
I am struggling trying to figure out how to replace these values. Thank you in advance for help.
Comment