Hello Dream Catcher,
As a matter of fact, you just walk into one of the authorized medical centers and do the medical test, you need to tell them that you have not yet applied and they will give you a hard copy of the test that you will later need to attach to your application when you apply. One thing that may not apply to you in this instance as things may be a bit different if you do that in Saudi, see I live in a neighboring country to Saudi (with Saudi Iqama) and I did the test in that country where they uploaded the results on the CIC immigration system.
Regarding the PCC, all you need to do is to write to the embassy in Riyadh informing them that you need to obtain the PCC and you're yet to have a file number they will then put your name on the gate so that you can be handed over a request to the authorities in Saudi. They will send you an email when the request can be collected. Another approach (not sure of but it's worth trying) you just appear at the embassy gate and tell the security that you need a request for PCC, they may give you one. Mind you, the request is a blank signed document that you will need to fill your information on it by hand.
Finally, I wouldn't in fact jump to getting the PCC in advance as the processing time may take longer than the validity of the PCC (this is what I was told by the embassy when I requested the letter), if that happens then you will probably have to do it again when ultimately requested requested by the visa center.
Good luck all ...