I am trying to create a button that will allow the removal of an entry into my family history however it is conditional. I want it to remove just the part pertaining to it. IE maternal birth defects. I can find that using match match(obsany("DEP FAM PMH"),"Birth Defects - Maternal") but can I also have something remove it? I have never tried it this way before but do to other aspects of this button I will need it to work this way. thoughts?
If the match returns 78, as the position of the string you are searching for, then you know to include the first 77 characters. If the string is 30 characters, then you know to continue at position 108.
Then utilize the sub(string,start, length) commands to put everything back together. Perhaps like the following?
sub(myexample,1,77)&sub(myexample,108)
Scott, are you referring to you would like a button on a form that will delete a value from an Observation term if it matched, as in delete all Observation values for that Obs Term, so that there is no history?
Would this be in the case, someone entered in incorrect data from the very beginning?
I want to only remove only that value. So the obsterm DEP FAM PMH holds the entire family past medical history however if for some reason they want to only remove one value from the DEP FAM PMH obs I would like to be able to do that and not clear the entire obsterm.
Joseph, I don't believe what you suggest would work because removing multiple would move everything over.
I would do the MATCH to get the start position of the string you don't want then use REMOVE - would be something like obsnow("DEP FAM PMH,remove(obsnow("DEP FAM PMH"),78,30))