Javascript doesn't have the keyword string in first place.
You are not supposed to give datatypes for variables, you may not even use var keyword before formal parameters.
Javascript interpreter can understand the type of the value a variable pointing. Since, variables doesn't have any types in particular and can be messed up any way, hence it is called weakly typed language.
Changing function showdiagnosis(string pid){} to
`function showdiagnosis(pid){}`
If you need you can use typeof keyword to know the type value passed through pid.
For example:
function showDiagnosis(pid){
if(typeof pid=='string')
//................
}
This link is valuable and you may want to check it:
Finding variable type in javascript
Check if a variable is a string
Check whether variable is number or string in javascript
And use proper naming conventions for function names, variables. In general, Javascript community follows showDiagnosis(pid) for your case. Start with small letter and capitalize every first letter of distinct words in the name so that it makes some sense for readers and increases readability.