LaRetta Posted January 25, 2003 Posted January 25, 2003 Hi everyone!! I have four text fields which will accept a Diagnosis code. Example codes are 309.9 or V61.2. A Client can be assigned up to four different diagnosis. Currently, these four fields (field format pop-up list) are based upon a Value List (use values from field Diagnosis::Diagnosis Code, all values). I also have (in Field Defs) each DiagnosisCode field, set to validation by member of this same Diagnosis Value List. But I have a hitch There is an additional validation required and I'm unsure whether to re-do my Value Lists (and thus validation by Value List) to trap this issue; whether I should create a validate by calc through Field Defs; or incorporate Lookups. However I go, I can't picture either the calcs or the *filtering* required in the Value List to isolate 'V' Codes for display or validation. The additional validation piece required is: 1) Diagnosis fields 1-3 (if not empty) must NOT accept a Code starting with 'V' and hopefully would only display non-V Codes on the pop-up list, and hopefully display a message box if a user tries to enter a V, explaining that they must enter V-Codes in Diagnosis 4 only. 2) The reverse is true. Diagnosis field 4 (if not empty), can only accept V codes (and hopefully would display and present a message to Users as above). So I'm unsure how best to handle this. I think I would prefer using Value Lists or lookups over calcs. What do ya'all suggest
RussBaker Posted January 25, 2003 Posted January 25, 2003 You could have your value list contain all the possible codes and not allow the user any choice except a member of the value list - but the list might get a bit long. You can validate the entry fields by calculation (but this will only present the message when the user leaves the field). The calcs for each of your 4 fields would be: Fields 1-3 Left (Fieldx,1) <>"V" Field 4 Left(Field4,1)="V" with each validation displaying the appropriate message. If you only want the V codes to display in the Field 4 value list, then you will need a separate relationship where you have a constant Key field in the Parent (="V") and the Field in the Child will be Left(Code,1). That way, only codes starting with "V" will show in the related value list.
LaRetta Posted January 25, 2003 Author Posted January 25, 2003 Oh Russ! I love your idea of using a Relationship instead of a calc!! If this new Relationship based upon 'V' can be used to control the display of the pop-ups attached to each Diagnosis, mightn't this same Relationship be used to validate what is entered, based upon that same Value List? As a matter of fact, couldn't I just add a small field to Diagnosis which indicates whether it's a V-Code or not? Like num =1? And the Relationship could be based upon this? I am most certainly going to try this; however, it will have to be later. I'm heading to the coast to run my dawg on the beach LaRetta
CobaltSky Posted January 26, 2003 Posted January 26, 2003 Embellishing Russ' worthy suggestion, I'd be inclined to suggest that you create a cDiagGroup field (a stored calc field of result type [/]number) in your diagnisis db, with a formula along the lines of: Case(Left(DiagnosisCode, 1) = "v", 4, 123) Then create two global number fields in your Clients file called gDiag4.num and gDiag123.num and enter 4 into gDiag4.num and 123 into gDiag123.num Next create a relationship called Diag4 which links gDiag4.num to cDiagGroup and a second relationship called Diag123 which links gDiag123.num to cDiagGroup. Finally, create a value list called DiagCodes4 which uses values from the DiagnosisCode field based on the Diag4 relationship, and a second value list called DiagCodes123 which uses values from the DiagnosisCode field based on the Diag123 relationship. With the above in place, you will be able to attach separate value lists to the first three and fourth diagnosis fields in the clients db, and will be able also to validate them separately as members of their respective value lists.
LaRetta Posted January 26, 2003 Author Posted January 26, 2003 Hi CobaltSky! Well, I implemented the Diagnosis relationship and it's perfect! I'm excited to learn how to *filter* Value Lists (and validations) by establishing a relationship based upon a stored calc!! I have other such Value Lists, for instance Staff Names (but I only want the pop-up to contain certain staff), and this same procedure will allow me to display and validate data entry in a much more User-friendly fashion Thanks again! LaRetta
Recommended Posts
This topic is 8042 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now